fix: quote len

This commit is contained in:
archer
2023-05-30 23:43:08 +08:00
parent 87c5cb6bca
commit 24319fe860
2 changed files with 2 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ export const streamFetch = ({ url, data, onMessage, abortSignal }: StreamFetchPr
read();
} catch (err: any) {
if (err?.message === 'The user aborted a request.') {
return resolve({ responseText, newChatId, quoteLen: 0, systemPrompt: '' });
return resolve({ responseText, newChatId, quoteLen, systemPrompt: '' });
}
reject(typeof err === 'string' ? err : err?.message || '请求异常');
}

View File

@@ -211,8 +211,6 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
router.replace(`/chat?modelId=${modelId}&chatId=${newChatId}`);
}
abortSignal.signal.aborted && (await delay(600));
// 设置聊天内容为完成状态
setChatData((state) => ({
...state,
@@ -229,9 +227,9 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
}));
// refresh data
generatingMessage();
loadHistory({ pageNum: 1, init: true });
loadMyModels(true);
generatingMessage();
},
[
chatId,