mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-26 04:02:47 +00:00
fix(explorer): handle empty folder direct link generation error (#288)
This commit is contained in:
parent
253991bc5e
commit
d896d1f165
|
|
@ -1212,6 +1212,17 @@ function startBatchGetDirectLinks(files: FileResponse[]): AppThunk<Promise<Direc
|
|||
}),
|
||||
);
|
||||
|
||||
// Check if there are any files to generate direct links for
|
||||
if (allFiles.length === 0) {
|
||||
enqueueSnackbar({
|
||||
message: i18next.t("modals.noFileCanGenerateSourceLink"),
|
||||
preventDuplicate: true,
|
||||
variant: "warning",
|
||||
action: DefaultCloseAction,
|
||||
});
|
||||
throw new Error("AbortError");
|
||||
}
|
||||
|
||||
return await dispatch(
|
||||
getFileDirectLinks({
|
||||
uris: allFiles.map((f) => getFileLinkedUri(f)),
|
||||
|
|
|
|||
Loading…
Reference in New Issue