mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(session): request aborted error when swtching sessions (cloudreve/cloudreve#2919)
This commit is contained in:
parent
0bf85fa0ab
commit
18c4e3d845
|
|
@ -70,7 +70,7 @@ import {
|
|||
ViewerGroup,
|
||||
ViewerSessionResponse,
|
||||
} from "./explorer.ts";
|
||||
import { AppError, Code, CrHeaders, defaultOpts, send, ThunkResponse } from "./request.ts";
|
||||
import { AppError, Code, CrHeaders, defaultOpts, isRequestAbortedError, send, ThunkResponse } from "./request.ts";
|
||||
import { CreateDavAccountService, DavAccount, ListDavAccountsResponse, ListDavAccountsService } from "./setting.ts";
|
||||
import { ListShareResponse, ListShareService } from "./share.ts";
|
||||
import { CaptchaResponse, SiteConfig } from "./site.ts";
|
||||
|
|
@ -115,7 +115,7 @@ export function getSiteConfig(section: string): ThunkResponse<SiteConfig> {
|
|||
},
|
||||
{
|
||||
...defaultOpts,
|
||||
noCredential: section != "basic",
|
||||
bypassSnackbar: (e) => isRequestAbortedError(e),
|
||||
errorSnackbarMsg: (e) => i18n.t("errLoadingSiteConfig", { ns: "common" }) + e.message,
|
||||
},
|
||||
),
|
||||
|
|
@ -373,6 +373,7 @@ export function sendRenameFile(req: RenameFileService): ThunkResponse<FileRespon
|
|||
},
|
||||
{
|
||||
...defaultOpts,
|
||||
bypassSnackbar: (e) => isRequestAbortedError(e),
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -277,3 +277,7 @@ export function send<T = any>(
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const isRequestAbortedError = (e: Error) => {
|
||||
return e.message == "Request aborted";
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue