From 09bf48e5a45c53f64f1ad5e5c43ce579d488c1c7 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 1 Feb 2025 10:54:00 +0200 Subject: [PATCH] feat(tray): support bookmark folders --- src/services/tray.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/services/tray.ts b/src/services/tray.ts index 756ed7be7..a03186010 100644 --- a/src/services/tray.ts +++ b/src/services/tray.ts @@ -91,15 +91,25 @@ function updateTrayMenu() { for (const bookmarkNote of parentNote?.children) { if (bookmarkNote.isLabelTruthy("bookmarkFolder")) { - // Ignore bookmark folders for now. - continue; + menuItems.push({ + label: bookmarkNote.title, + type: "submenu", + submenu: bookmarkNote.children.map((subitem) => { + return { + label: subitem.title, + type: "normal", + click: () => openInSameTab(subitem) + }; + }) + }); + } else { + menuItems.push({ + label: bookmarkNote.title, + type: "normal", + click: () => openInSameTab(bookmarkNote) + }); } - menuItems.push({ - label: bookmarkNote.title, - type: "normal", - click: () => openInSameTab(bookmarkNote) - }); } return menuItems;