mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-02 20:21:19 +02:00
feat: remove locked note deletion from multiselect
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user