mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-03 12:41:45 +02:00
feat: impl permanent delete in multi select trash
This commit is contained in:
@@ -31,6 +31,7 @@ const DeleteOption = createOption("deleteOption", Icon.Trash, async function (
|
||||
)
|
||||
return;
|
||||
const item = state.selectedItems[0];
|
||||
|
||||
var isAnyNoteOpened = false;
|
||||
const items = state.selectedItems.map((item) => {
|
||||
if (item.id === editorStore.get().session.id) isAnyNoteOpened = true;
|
||||
@@ -38,6 +39,13 @@ const DeleteOption = createOption("deleteOption", Icon.Trash, async function (
|
||||
return item.id;
|
||||
});
|
||||
|
||||
if (item.dateDeleted) {
|
||||
// we are in trash
|
||||
await db.trash.delete(...items);
|
||||
trashStore.refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isAnyNoteOpened) {
|
||||
editorStore.newSession();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user