feat(files): add bulk download for files and guard folder downloads (#18)
CD — Deployment / deploy (push) Successful in 15s

PR automatique de feat/bulk-download-folders vers main.

---------

Co-authored-by: xEsiah <[email protected]>
Reviewed-on: #18
Reviewed-by: Esiah <[email protected]>
Co-authored-by: Gitea Actions <-[email protected]>
This commit was merged in pull request #18.
This commit is contained in:
Gitea Actions
2026-10-24 22:01:16 +00:00
committed by Esiah
co-authored by Esiah
parent f39c07e58c
commit 220ca62974
2 changed files with 15 additions and 7 deletions
+13 -7
View File
@@ -636,13 +636,19 @@ export const Browser = () => {
size="sm"
variant="secondary"
onClick={() => {
for (const target of selectedItems) {
if (target.type === "file") {
const link = document.createElement("a");
link.href = api.downloadUrl(target.id);
link.download = target.name;
link.click();
}
const files = selectedItems.filter((t) => t.type === "file");
if (files.length === 0) {
toast.info(t("Seuls les fichiers peuvent être téléchargés."));
return;
}
for (const target of files) {
const link = document.createElement("a");
link.href = api.downloadUrl(target.id);
link.download = target.name;
link.click();
}
if (files.length < selectedItems.length) {
toast.info(t("Les dossiers n'ont pas été téléchargés."));
}
}}
>