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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user