fix: don't show confirm dialog if delete note count is 1

This commit is contained in:
thecodrr
2022-03-23 15:37:14 +05:00
parent 1b44de4ed1
commit 02a42661b0
2 changed files with 3 additions and 3 deletions

View File

@@ -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 (

View File

@@ -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,
},