From f4702eeafbb45004df66a6fe67e36dd5de668e2d Mon Sep 17 00:00:00 2001 From: thecodrr Date: Sun, 15 Mar 2020 10:02:50 +0500 Subject: [PATCH] feat: remove locked note deletion from multiselect --- apps/web/src/common/selectionoptions.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/apps/web/src/common/selectionoptions.js b/apps/web/src/common/selectionoptions.js index 7381329f3..b6222fcfa 100644 --- a/apps/web/src/common/selectionoptions.js +++ b/apps/web/src/common/selectionoptions.js @@ -32,22 +32,7 @@ const DeleteOption = createOption(Icon.Trash2, async function(state) { const editorState = editorStore.getState(); const items = state.selectedItems.map(async item => { if (item.id === editorState.session.id) isAnyNoteOpened = true; - if (item.locked) { - if ( - !(await confirm( - Icon.Trash2, - "Delete", - "This is a locked note. Are you sure you want to delete it?" - )) || - !(await showPasswordDialog("unlock_note", password => { - return db.vault - .unlock(password) - .then(() => true) - .catch(() => false); - })) - ) - return 0; - } + if (item.locked) return 0; return item.id; });