fix(explorer): error snackbar not shown while opening expired single file share shortcut

This commit is contained in:
Aaron Liu 2025-05-23 15:34:04 +08:00
parent 28591ae5b4
commit 5d4ea27505
2 changed files with 9 additions and 6 deletions

View File

@ -231,7 +231,7 @@ export function sendRefreshToken(req: RefreshTokenRequest): ThunkResponse<Token>
};
}
export function getFileList(req: ListFileService): ThunkResponse<ListResponse> {
export function getFileList(req: ListFileService, skipSnackbar = true): ThunkResponse<ListResponse> {
return async (dispatch, _getState) => {
return await dispatch(
send(
@ -282,7 +282,7 @@ export function getUserInfo(uid: string): ThunkResponse<User> {
},
{
...defaultOpts,
bypassSnackbar: (_e) => true,
bypassSnackbar: (_e) => skipSnackbar,
},
),
);

View File

@ -1163,10 +1163,13 @@ export function refreshSingleFileSymbolicLinks(file: FileResponse): AppThunk<Pro
}
const currentUrl = new CrUri(getFileLinkedUri(file));
const latestList = await dispatch(
getFileList({
uri: currentUrl.setPath("").toString(),
page_size: 50,
}),
getFileList(
{
uri: currentUrl.setPath("").toString(),
page_size: 50,
},
false,
),
);
if (latestList.files.length != 1) {
return file;