From a8b8c390e2f37c2248e14a1815a6c2b2ca2bef25 Mon Sep 17 00:00:00 2001 From: Hassan El Mghari Date: Sun, 5 Mar 2023 12:37:31 -0500 Subject: [PATCH] improved error message for too many generations --- pages/api/generate.ts | 2 +- pages/dream.tsx | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pages/api/generate.ts b/pages/api/generate.ts index cf691b0e..354d0295 100644 --- a/pages/api/generate.ts +++ b/pages/api/generate.ts @@ -41,7 +41,7 @@ export default async function handler( res .status(429) .json( - "We're temporarily limiting generations to 1 per day because of high traffic. Please try again in 24 hours. For any questions, email hassan@hey.com" + "We're temporarily limiting generations to 1 per day because of high traffic. For any questions, email hassan@hey.com" ); return; } diff --git a/pages/dream.tsx b/pages/dream.tsx index 549ca61f..d55de06a 100644 --- a/pages/dream.tsx +++ b/pages/dream.tsx @@ -15,7 +15,6 @@ import appendNewToName from "../utils/appendNewToName"; import downloadPhoto from "../utils/downloadPhoto"; import DropDown from "../components/DropDown"; import { roomType, rooms, themeType, themes } from "../utils/dropdownTypes"; -import CountUp from "react-countup"; import { GenerateResponseData } from "./api/generate"; // Configuration for the uploader @@ -257,14 +256,19 @@ const Home: NextPage = () => { )} {error && (
- {error} +
+ Please try again in 24 hours +
+
+ {error} +
)}
- {originalPhoto && !loading && ( + {originalPhoto && !loading && !error && (