mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
fix: don't show confirm dialog if delete note count is 1
This commit is contained in:
@@ -8,9 +8,9 @@ import Vault from "./vault";
|
||||
import { showItemDeletedToast } from "./toasts";
|
||||
import { TaskManager } from "./task-manager";
|
||||
|
||||
async function moveNotesToTrash(notes: any[]) {
|
||||
async function moveNotesToTrash(notes: any[], confirm = true) {
|
||||
const item = notes[0];
|
||||
if (!(await showMultiDeleteConfirmation(notes.length))) return;
|
||||
if (confirm && !(await showMultiDeleteConfirmation(notes.length))) return;
|
||||
|
||||
if (notes.length === 1) {
|
||||
if (
|
||||
|
||||
@@ -377,7 +377,7 @@ const menuItems = [
|
||||
items.length === 1 && db.monographs.isPublished(items[0].id),
|
||||
disableReason: "Please unpublish this note to move it to trash",
|
||||
onClick: async ({ items }) => {
|
||||
await Multiselect.moveNotesToTrash(items);
|
||||
await Multiselect.moveNotesToTrash(items, items.length > 1);
|
||||
},
|
||||
multiSelect: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user