tauri-app: tray settings menu item

Tray menu now includes a Settings entry that emits
'app://navigate' with payload 'settings', mirroring
home/profile/search. client.ts listenTrayEvents type
extended to include 'settings'.
This commit is contained in:
tomdebone
2026-07-07 18:57:45 +02:00
parent 43fc889d47
commit 6a82c906de
2 changed files with 14 additions and 2 deletions
+2 -2
View File
@@ -355,13 +355,13 @@ export async function showNotification(
/// The handler receives the event payload (empty object for these
/// cases). Returns an unsubscribe function.
export async function listenTrayEvents(
handler: (event: "show" | "home" | "compose" | "profile" | "search") => void,
handler: (event: "show" | "home" | "compose" | "profile" | "search" | "settings") => void,
): Promise<() => void> {
const { listen } = await import("@tauri-apps/api/event");
const unlisteners: Array<() => void> = [];
const u1 = await listen("app://show", () => handler("show"));
const u2 = await listen("app://navigate", (e) => {
handler(e.payload as "home" | "profile" | "search");
handler(e.payload as "home" | "profile" | "search" | "settings");
});
const u3 = await listen("app://compose", () => handler("compose"));
unlisteners.push(u1, u2, u3);