mirror of
https://github.com/FranP-code/ChatGPT.git
synced 2025-10-13 00:13:25 +00:00
Manually check for updates
This commit is contained in:
@@ -24,6 +24,7 @@ pub fn init() -> Menu {
|
||||
MenuItem::About(name.into(), AboutMetadata::default()).into(),
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
CustomMenuItem::new("about".to_string(), "About ChatGPT").into(),
|
||||
CustomMenuItem::new("check_update".to_string(), "Check for Updates").into(),
|
||||
MenuItem::Services.into(),
|
||||
MenuItem::Hide.into(),
|
||||
MenuItem::HideOthers.into(),
|
||||
@@ -192,6 +193,17 @@ pub fn menu_handler(event: WindowMenuEvent<tauri::Wry>) {
|
||||
format!("Version {}", tauri_conf.package.version.unwrap()),
|
||||
);
|
||||
}
|
||||
"check_update" => {
|
||||
tauri::async_runtime::spawn(async move {
|
||||
let result = app.updater().check().await;
|
||||
let update_resp = result.unwrap();
|
||||
if update_resp.is_update_available() {
|
||||
tauri::async_runtime::spawn(async move {
|
||||
utils::prompt_for_install(app, update_resp).await.unwrap();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// Preferences
|
||||
"control_center" => window::control_window(&app),
|
||||
"restart" => tauri::api::process::restart(&app.env()),
|
||||
|
||||
Reference in New Issue
Block a user