Adds confirmation for deletion of items including folders
Updates the file deletion confirmation logic to distinguish between deleting multiple items with or without folders. Introduces a new translation string for a clearer user prompt when folders and their contents are included in the deletion. Improves clarity and reduces user error when performing bulk deletions.
This commit is contained in:
@@ -846,6 +846,7 @@
|
||||
"confirmDeleteMessage": "Are you sure you want to delete <strong>{{name}}</strong>?",
|
||||
"confirmDeleteSingleItem": "Are you sure you want to permanently delete \"{{name}}\"?",
|
||||
"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?",
|
||||
"deleteDirectoryWarning": "This will delete the folder and all its contents.",
|
||||
"actionCannotBeUndone": "This action cannot be undone.",
|
||||
|
||||
@@ -603,7 +603,12 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
|
||||
});
|
||||
}
|
||||
} 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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user