feat: remove locked note deletion from multiselect

This commit is contained in:
thecodrr
2020-03-15 10:02:50 +05:00
parent 585acc2c2c
commit f4702eeafb

View File

@@ -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;
});