Skip to content

Commit c365f0a

Browse files
feat: add restart and reload menu items on macOS (#9212)
1 parent 01b1294 commit c365f0a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/desktop/src/menu.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Menu, MenuItem, PredefinedMenuItem, Submenu } from "@tauri-apps/api/menu"
22
import { type as ostype } from "@tauri-apps/plugin-os"
3+
import { invoke } from "@tauri-apps/api/core"
4+
import { relaunch } from "@tauri-apps/plugin-process"
35

46
import { runUpdater, UPDATER_ENABLED } from "./updater"
57
import { installCli } from "./cli"
@@ -24,6 +26,17 @@ export async function createMenu() {
2426
action: () => installCli(),
2527
text: "Install CLI...",
2628
}),
29+
await MenuItem.new({
30+
action: async () => window.location.reload(),
31+
text: "Reload Webview",
32+
}),
33+
await MenuItem.new({
34+
action: async () => {
35+
await invoke("kill_sidecar").catch(() => undefined)
36+
await relaunch().catch(() => undefined)
37+
},
38+
text: "Restart",
39+
}),
2740
await PredefinedMenuItem.new({
2841
item: "Separator",
2942
}),

0 commit comments

Comments
 (0)