perf: abort

This commit is contained in:
archer
2023-07-18 15:20:58 +08:00
parent 8a25aeabc4
commit 2330186a09
8 changed files with 50 additions and 28 deletions

View File

@@ -66,7 +66,7 @@ const Chat = () => {
const newTitle = prompts[0].content?.slice(0, 20) || '新对话';
// update history
if (newChatId) {
if (newChatId && !controller.signal.aborted) {
forbidRefresh.current = true;
const newHistory: ChatHistoryItemType = {
_id: newChatId,

View File

@@ -69,7 +69,7 @@ const ShareChat = ({ shareId, chatId }: { shareId: string; chatId: string }) =>
shareId
});
if (newChatId) {
if (newChatId && !controller.signal.aborted) {
router.replace({
query: {
shareId,