From c4a22336ac64994a1c0cf5a3be16dd01f012389c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 30 Sep 2019 14:54:18 +0200 Subject: [PATCH] warn if folder failed to be removed --- src/app/files/file-explorer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index 3e1acf9695..aa8cb1861c 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -237,7 +237,10 @@ function fileExplorer (localRegistry, files, menuItems) { } actions['Delete'] = () => { if (self.files.isReadOnly(key)) { return tooltip('cannot delete folder. ' + self.files.type + ' is a read only explorer') } - modalDialogCustom.confirm('Confirm to delete a folder', 'Are you sure you want to delete this folder?', () => { files.remove(key) }, () => {}) + modalDialogCustom.confirm('Confirm to delete a folder', 'Are you sure you want to delete this folder?', + () => { + if (!files.remove(key)) tooltip(`failed to remove ${key}. Make sure the directory is empty before removing it.`) + }, () => {}) } MENU_HANDLE = contextMenu(event, actions) })