Skip to content

Build your personal knowledge base with Trilium Notes

fix(tray): error if today's note was missing

Elian Dorane10256e5bdd9
diff --git a/src/services/tray.ts b/src/services/tray.ts
index 029a166b8b..b2e7eb0a87 100644
--- a/src/services/tray.ts
+++ b/src/services/tray.ts
@@ -12,6 +12,7 @@ import type BRecentNote from "../becca/entities/brecent_note.js";
import { ipcMain, nativeTheme } from "electron/main";
import { default as i18next, t } from "i18next";
import { isDev } from "./utils.js";
+import cls from "./cls.js";
let tray: Tray;
// `mainWindow.isVisible` doesn't work with `mainWindow.show` and `mainWindow.hide` - it returns `false` when the window
@@ -164,7 +165,7 @@ function updateTrayMenu() {
label: t("tray.today"),
type: "normal",
icon: getIconPath("today"),
- click: () => openInSameTab(date_notes.getTodayNote())
+ click: cls.wrap(() => openInSameTab(date_notes.getTodayNote()))
},
{
label: t("tray.bookmarks"),