diff --git a/frontend/src/lib/i18n.tsx b/frontend/src/lib/i18n.tsx index fe3de90..dd2dec2 100644 --- a/frontend/src/lib/i18n.tsx +++ b/frontend/src/lib/i18n.tsx @@ -204,6 +204,8 @@ const en: Record = { "{count} éléments seront déplacés.": "{count} items will be moved.", "{count} élément(s) seront placés dans la corbeille.": "{count} item(s) will be moved to the trash.", + "Seuls les fichiers peuvent être téléchargés.": "Only files can be downloaded.", + "Les dossiers n'ont pas été téléchargés.": "Folders were not downloaded.", // --- Visionneuse ------------------------------------------------------- "Lecture impossible.": "Unable to read.", diff --git a/frontend/src/pages/Browser.tsx b/frontend/src/pages/Browser.tsx index dd632eb..a8ac535 100644 --- a/frontend/src/pages/Browser.tsx +++ b/frontend/src/pages/Browser.tsx @@ -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.")); } }} >