Fix upgrade cancel

This commit is contained in:
Gregory Schier
2024-05-14 07:08:57 -07:00
parent 36d8c56872
commit 816bc543d7
3 changed files with 13 additions and 10 deletions

View File

@@ -53,22 +53,21 @@ impl YaakUpdater {
) -> Result<bool, tauri_plugin_updater::Error> {
self.last_update_check = SystemTime::now();
let enabled = !is_dev();
info!(
"Checking for updates mode={} enabled={}",
mode, enabled
);
let enabled = is_dev();
info!("Checking for updates mode={} enabled={}", mode, enabled);
if !enabled {
return Ok(false);
}
match app_handle
let update_check_result = app_handle
.updater_builder()
.header("X-Update-Mode", mode.to_string())?
.build()?
.check()
.await
.await;
match update_check_result
{
Ok(Some(update)) => {
let h = app_handle.clone();
@@ -78,6 +77,8 @@ impl YaakUpdater {
"{} is available. Would you like to download and install it now?",
update.version
))
.ok_button_label("Download")
.cancel_button_label("Later")
.title("Update Available")
.show(|confirmed| {
if !confirmed {
@@ -89,6 +90,8 @@ impl YaakUpdater {
if h.dialog()
.message("Would you like to restart the app?")
.title("Update Installed")
.ok_button_label("Restart")
.cancel_button_label("Later")
.blocking_show()
{
h.restart();

View File

@@ -6,7 +6,7 @@
"frontendDist": "../dist"
},
"productName": "Yaak",
"version": "2024.4.0-beta.3",
"version": "2024.4.0-beta.2",
"identifier": "app.yaak.desktop",
"app": {
"withGlobalTauri": false,

View File

@@ -40,7 +40,7 @@ export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Prop
<div className="pointer-events-none">
<RecentRequestsDropdown />
</div>
<div className="flex-1 flex items-center h-full justify-end pointer-events-none">
<div className="flex-1 flex gap-1 items-center h-full justify-end pointer-events-none">
<ImportCurlButton />
<SettingsDropdown />
{(osInfo?.osType === 'linux' || osInfo?.osType === 'windows') && (