forked from XiaoMo/ChatGPT-Next-Web
fix: typo reqestTimeoutId -> requestTimeoutId
This commit is contained in:
parent
aed6b34950
commit
06534fa0ae
@ -60,7 +60,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// make a fetch request
|
// make a fetch request
|
||||||
const reqestTimeoutId = setTimeout(
|
const requestTimeoutId = setTimeout(
|
||||||
() => controller.abort(),
|
() => controller.abort(),
|
||||||
REQUEST_TIMEOUT_MS,
|
REQUEST_TIMEOUT_MS,
|
||||||
);
|
);
|
||||||
@ -75,7 +75,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
fetchEventSource(chatPath, {
|
fetchEventSource(chatPath, {
|
||||||
...chatPayload,
|
...chatPayload,
|
||||||
async onopen(res) {
|
async onopen(res) {
|
||||||
clearTimeout(reqestTimeoutId);
|
clearTimeout(requestTimeoutId);
|
||||||
if (res.status === 401) {
|
if (res.status === 401) {
|
||||||
responseText += "\n\n" + Locale.Error.Unauthorized;
|
responseText += "\n\n" + Locale.Error.Unauthorized;
|
||||||
return finish();
|
return finish();
|
||||||
@ -106,7 +106,7 @@ export class ChatGPTApi implements LLMApi {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const res = await fetch(chatPath, chatPayload);
|
const res = await fetch(chatPath, chatPayload);
|
||||||
clearTimeout(reqestTimeoutId);
|
clearTimeout(requestTimeoutId);
|
||||||
|
|
||||||
const resJson = await res.json();
|
const resJson = await res.json();
|
||||||
const message = this.extractMessage(resJson);
|
const message = this.extractMessage(resJson);
|
||||||
|
Loading…
Reference in New Issue
Block a user