From f298774f2d9899276f47acf527c1441501b5611e Mon Sep 17 00:00:00 2001 From: tanqicun-mac <411707420@qq.com> Date: Thu, 21 Sep 2023 19:40:16 +0800 Subject: [PATCH] draw: fix bug --- app/client/platforms/openai.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 3e19cb49..6261ddea 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -498,7 +498,6 @@ export class ChatGPTApi implements LLMApi { const entireContent = prefixContent + `[![${taskId}](${imgUrl})](${imgUrl})`; isFinished = true; - options.onFinish(entireContent); botMessage.attr.imgUrl = imgUrl; // if (statusResJson.action === "DESCRIBE" && statusResJson.prompt) { @@ -506,20 +505,21 @@ export class ChatGPTApi implements LLMApi { // } botMessage.attr.status = "SUCCESS"; botMessage.attr.finished = true; + options.onFinish(entireContent); break; } case 40: content = statusResJson.data.error || Locale.Midjourney.UnknownReason; isFinished = true; + botMessage.attr.status = "FAILURE"; + botMessage.attr.finished = true; options.onFinish( prefixContent + `**${ Locale.Midjourney.TaskStatus }:** [${new Date().toLocaleString()}] - ${content}`, ); - botMessage.attr.status = "FAILURE"; - botMessage.attr.finished = true; break; case 0: content = Locale.Midjourney.TaskNotStart;