mirror of
https://github.com/cinnyapp/cinny-desktop.git
synced 2024-12-28 02:16:11 +00:00
feat: implement quit event
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
6f83708511
commit
409fc0cd1a
|
@ -6,6 +6,8 @@
|
|||
mod menu;
|
||||
mod tray;
|
||||
|
||||
use tauri::Manager;
|
||||
|
||||
fn main() {
|
||||
let builder = tauri::Builder::default();
|
||||
|
||||
|
@ -14,7 +16,14 @@ fn main() {
|
|||
|
||||
let builder = builder
|
||||
.system_tray(tray::system_tray())
|
||||
.on_system_tray_event(tray::system_tray_handler);
|
||||
.on_system_tray_event(tray::system_tray_handler)
|
||||
.setup(|app| {
|
||||
let handle = app.handle();
|
||||
app.listen_global("quit", move |_| {
|
||||
handle.exit(0);
|
||||
});
|
||||
Ok(())
|
||||
});
|
||||
|
||||
builder
|
||||
.build(tauri::generate_context!())
|
||||
|
|
Loading…
Reference in a new issue