mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
feat: add 'Check for updates' option to tray menu and improve update handling
This commit is contained in:
parent
e29f2fcfa5
commit
6157eb75a1
4 changed files with 41 additions and 15 deletions
|
@ -23,6 +23,7 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
|||
.build(app)?])
|
||||
.items(&[&MenuItemBuilder::with_id("show", "Show/Hide").build(app)?])
|
||||
.items(&[&MenuItemBuilder::with_id("keybind", "Change keybind").build(app)?])
|
||||
.items(&[&MenuItemBuilder::with_id("check_updates", "Check for updates").build(app)?])
|
||||
.items(&[&MenuItemBuilder::with_id("quit", "Quit").build(app)?])
|
||||
.build()?,
|
||||
)
|
||||
|
@ -48,6 +49,13 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
|||
let _ = _app.track_event("tray_keybind_change", None);
|
||||
window.emit("change_keybind", ()).unwrap();
|
||||
}
|
||||
"check_updates" => {
|
||||
let _ = _app.track_event("tray_check_updates", None);
|
||||
let app_handle = _app.app_handle().clone();
|
||||
tauri::async_runtime::spawn(async move {
|
||||
crate::api::updater::check_for_updates(app_handle, true).await;
|
||||
});
|
||||
}
|
||||
_ => (),
|
||||
})
|
||||
.icon(icon)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue