diff --git a/src/chatbox.tsx b/src/chatbox.tsx index b06b9d6..5ddc350 100644 --- a/src/chatbox.tsx +++ b/src/chatbox.tsx @@ -13,6 +13,7 @@ export default function ChatBOX(props: { const [inputMsg, setInputMsg] = useState(""); const [showGenerating, setShowGenerating] = useState(false); const [generatingMessage, setGeneratingMessage] = useState(""); + const [showRetry, setShowRetry] = useState(false); const client = new ChatGPT(chatStore.apiKey); @@ -113,6 +114,7 @@ export default function ChatBOX(props: { console.log("postBeginIndex", chatStore.postBeginIndex); setChatStore({ ...chatStore }); } catch (error) { + setShowRetry(true); alert(error); } finally { setShowGenerating(false); @@ -235,6 +237,19 @@ export default function ChatBOX(props: { ...
)} + {showRetry && ( ++ +
+ )}