Commit 24319fe8 by archer

fix: quote len

parent 87c5cb6b
...@@ -50,7 +50,7 @@ export const streamFetch = ({ url, data, onMessage, abortSignal }: StreamFetchPr ...@@ -50,7 +50,7 @@ export const streamFetch = ({ url, data, onMessage, abortSignal }: StreamFetchPr
read(); read();
} catch (err: any) { } catch (err: any) {
if (err?.message === 'The user aborted a request.') { 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 || '请求异常'); reject(typeof err === 'string' ? err : err?.message || '请求异常');
} }
......
...@@ -211,8 +211,6 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => { ...@@ -211,8 +211,6 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
router.replace(`/chat?modelId=${modelId}&chatId=${newChatId}`); router.replace(`/chat?modelId=${modelId}&chatId=${newChatId}`);
} }
abortSignal.signal.aborted && (await delay(600));
// 设置聊天内容为完成状态 // 设置聊天内容为完成状态
setChatData((state) => ({ setChatData((state) => ({
...state, ...state,
...@@ -229,9 +227,9 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => { ...@@ -229,9 +227,9 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
})); }));
// refresh data // refresh data
generatingMessage();
loadHistory({ pageNum: 1, init: true }); loadHistory({ pageNum: 1, init: true });
loadMyModels(true); loadMyModels(true);
generatingMessage();
}, },
[ [
chatId, chatId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment