mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
web: nuke Remove from topic menu item
This commit is contained in:
committed by
Abdullah Atta
parent
da47ef159b
commit
12e6688f48
@@ -463,32 +463,6 @@ const menuItems = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ key: "sep3", type: "separator" },
|
{ key: "sep3", type: "separator" },
|
||||||
{
|
|
||||||
key: "removefromtopic",
|
|
||||||
title: "Remove from topic",
|
|
||||||
icon: Icon.TopicRemove,
|
|
||||||
hidden: ({ context }) => context?.type !== "topic",
|
|
||||||
onClick: async ({ items, context }) => {
|
|
||||||
try {
|
|
||||||
if (!context.value?.topic || !context.value?.id)
|
|
||||||
throw new Error("context is missing");
|
|
||||||
|
|
||||||
const ids = items.map((i) => i.id);
|
|
||||||
|
|
||||||
await db.notes.removeFromNotebook(
|
|
||||||
{ id: context.value.id, topic: context.value.topic },
|
|
||||||
...ids
|
|
||||||
);
|
|
||||||
|
|
||||||
store.refresh();
|
|
||||||
|
|
||||||
showToast("success", "Note removed from topic.");
|
|
||||||
} catch (e) {
|
|
||||||
showToast("error", `Failed to remove note from topic: ${e.message}.`);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
multiSelect: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: "movetotrash",
|
key: "movetotrash",
|
||||||
title: "Move to trash",
|
title: "Move to trash",
|
||||||
|
|||||||
Reference in New Issue
Block a user