fix: #1612 infinite loading

This commit is contained in:
Yidadaa
2023-05-20 19:58:12 +08:00
parent bcb18ff2f4
commit af497c96ec
8 changed files with 90 additions and 84 deletions

View File

@@ -28,6 +28,7 @@ export const ChatControllerPool = {
remove(sessionIndex: number, messageId: number) {
const key = this.key(sessionIndex, messageId);
this.controllers[key]?.abort();
delete this.controllers[key];
},

View File

@@ -6,7 +6,7 @@ import Locale from "../../locales";
import {
EventStreamContentType,
fetchEventSource,
} from "@microsoft/fetch-event-source";
} from "@fortaine/fetch-event-source";
import { prettyObject } from "@/app/utils/format";
export class ChatGPTApi implements LLMApi {
@@ -145,6 +145,7 @@ export class ChatGPTApi implements LLMApi {
},
onerror(e) {
options.onError?.(e);
throw e;
},
openWhenHidden: true,
});