mark initial response as unfinished.

This commit is contained in:
Wentao Lyu 2023-04-11 03:42:05 +08:00
parent 9871127114
commit f5f327e79e
2 changed files with 3 additions and 2 deletions

View file

@ -188,14 +188,14 @@ export default function Message({
)} )}
</div> </div>
</div> </div>
{!submitting && cancelled ? ( {!isSubmitting && cancelled ? (
<div className="flex flex min-h-[20px] flex-grow flex-col items-start gap-2 gap-4 text-red-500"> <div className="flex flex min-h-[20px] flex-grow flex-col items-start gap-2 gap-4 text-red-500">
<div className="rounded-md border border-blue-400 bg-blue-500/10 px-3 py-2 text-sm text-gray-600 dark:text-gray-100"> <div className="rounded-md border border-blue-400 bg-blue-500/10 px-3 py-2 text-sm text-gray-600 dark:text-gray-100">
{`This is a cancelled message.`} {`This is a cancelled message.`}
</div> </div>
</div> </div>
) : null} ) : null}
{!submitting && unfinished ? ( {!isSubmitting && unfinished ? (
<div className="flex flex min-h-[20px] flex-grow flex-col items-start gap-2 gap-4 text-red-500"> <div className="flex flex min-h-[20px] flex-grow flex-col items-start gap-2 gap-4 text-red-500">
<div className="rounded-md border border-blue-400 bg-blue-500/10 px-3 py-2 text-sm text-gray-600 dark:text-gray-100"> <div className="rounded-md border border-blue-400 bg-blue-500/10 px-3 py-2 text-sm text-gray-600 dark:text-gray-100">
{`This is an unfinished message. It might because the AI is still generating or it has been aborted. Refresh later to see more updates.`} {`This is an unfinished message. It might because the AI is still generating or it has been aborted. Refresh later to see more updates.`}

View file

@ -106,6 +106,7 @@ const useMessageHandler = () => {
parentMessageId: isRegenerate ? messageId : fakeMessageId, parentMessageId: isRegenerate ? messageId : fakeMessageId,
messageId: (isRegenerate ? messageId : fakeMessageId) + '_', messageId: (isRegenerate ? messageId : fakeMessageId) + '_',
conversationId, conversationId,
unfinished: true,
submitting: true submitting: true
}; };