Skip to content

Commit

Permalink
feat: support restart app on tray
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Aug 14, 2022
1 parent cb48600 commit 66ccbf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn main() -> std::io::Result<()> {
.add_item(CustomMenuItem::new("system_proxy", "System Proxy"))
.add_item(CustomMenuItem::new("tun_mode", "Tun Mode"))
.add_item(CustomMenuItem::new("restart_clash", "Restart Clash"))
.add_item(CustomMenuItem::new("restart_app", "Restart App"))
.add_native_item(SystemTrayMenuItem::Separator)
.add_item(CustomMenuItem::new("quit", "Quit").accelerator("CmdOrControl+Q"));

Expand Down Expand Up @@ -91,6 +92,9 @@ fn main() -> std::io::Result<()> {
let core = app_handle.state::<core::Core>();
crate::log_if_err!(core.restart_clash());
}
"restart_app" => {
api::process::restart(&app_handle.env());
}
"quit" => {
resolve::resolve_reset(app_handle);
app_handle.exit(0);
Expand Down

0 comments on commit 66ccbf7

Please sign in to comment.