web: add support for printing notes (#2551)

Co-authored-by: Abdullah Atta <abdullahatta@streetwriters.co>
This commit is contained in:
Muhammad Ali
2023-05-25 12:19:21 +05:00
committed by GitHub
parent 571f15b556
commit 2761222b36

View File

@@ -373,6 +373,18 @@ const menuItems = [
items: colorsToMenuItems()
},
{ key: "sep2", type: "separator" },
{
key: "print",
title: "Print",
disabled: ({ note }) => {
if (!db.notes.note(note.id).synced()) return notFullySyncedText;
if (note.locked) return "Locked notes cannot be printed.";
},
icon: Icon.Print,
onClick: async ({ note }) => {
await exportNotes("pdf", [note.id]);
}
},
{
key: "publish",
disabled: ({ note }) => {