Feature request: Add delete confirmation dialog to file manager #344

Merged
thorved merged 3 commits from feature/file-manager-delete-confirmation into dev-1.8.0 2025-10-05 00:08:55 +00:00
2 changed files with 7 additions and 1 deletions
Showing only changes of commit 05c019dfc2 - Show all commits
+1
View File
@@ -846,6 +846,7 @@
"confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?", "confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?",
"confirmDeleteSingleItem": "Are you sure you want to permanently delete \"{{name}}\"?", "confirmDeleteSingleItem": "Are you sure you want to permanently delete \"{{name}}\"?",
"confirmDeleteMultipleItems": "Are you sure you want to permanently delete {{count}} items?", "confirmDeleteMultipleItems": "Are you sure you want to permanently delete {{count}} items?",
"confirmDeleteMultipleItemsWithFolders": "Are you sure you want to permanently delete {{count}} items? This includes folders and their contents.",
"confirmDeleteFolder": "Are you sure you want to permanently delete the folder \"{{name}}\" and all its contents?", "confirmDeleteFolder": "Are you sure you want to permanently delete the folder \"{{name}}\" and all its contents?",
"deleteDirectoryWarning": "This will delete the folder and all its contents.", "deleteDirectoryWarning": "This will delete the folder and all its contents.",
"actionCannotBeUndone": "This action cannot be undone.", "actionCannotBeUndone": "This action cannot be undone.",
2
@@ -603,7 +603,12 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
}); });
} }
} else { } else {
confirmMessage = t("fileManager.confirmDeleteMultipleItems", { const hasDirectory = files.some((file) => file.type === "directory");
const translationKey = hasDirectory
? "fileManager.confirmDeleteMultipleItemsWithFolders"
: "fileManager.confirmDeleteMultipleItems";
confirmMessage = t(translationKey, {
count: files.length, count: files.length,
}); });
} }