mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 15:51:23 +02:00
Fix upgrade cancel
This commit is contained in:
@@ -53,22 +53,21 @@ impl YaakUpdater {
|
|||||||
) -> Result<bool, tauri_plugin_updater::Error> {
|
) -> Result<bool, tauri_plugin_updater::Error> {
|
||||||
self.last_update_check = SystemTime::now();
|
self.last_update_check = SystemTime::now();
|
||||||
|
|
||||||
let enabled = !is_dev();
|
let enabled = is_dev();
|
||||||
info!(
|
info!("Checking for updates mode={} enabled={}", mode, enabled);
|
||||||
"Checking for updates mode={} enabled={}",
|
|
||||||
mode, enabled
|
|
||||||
);
|
|
||||||
|
|
||||||
if !enabled {
|
if !enabled {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
match app_handle
|
let update_check_result = app_handle
|
||||||
.updater_builder()
|
.updater_builder()
|
||||||
.header("X-Update-Mode", mode.to_string())?
|
.header("X-Update-Mode", mode.to_string())?
|
||||||
.build()?
|
.build()?
|
||||||
.check()
|
.check()
|
||||||
.await
|
.await;
|
||||||
|
|
||||||
|
match update_check_result
|
||||||
{
|
{
|
||||||
Ok(Some(update)) => {
|
Ok(Some(update)) => {
|
||||||
let h = app_handle.clone();
|
let h = app_handle.clone();
|
||||||
@@ -78,6 +77,8 @@ impl YaakUpdater {
|
|||||||
"{} is available. Would you like to download and install it now?",
|
"{} is available. Would you like to download and install it now?",
|
||||||
update.version
|
update.version
|
||||||
))
|
))
|
||||||
|
.ok_button_label("Download")
|
||||||
|
.cancel_button_label("Later")
|
||||||
.title("Update Available")
|
.title("Update Available")
|
||||||
.show(|confirmed| {
|
.show(|confirmed| {
|
||||||
if !confirmed {
|
if !confirmed {
|
||||||
@@ -89,6 +90,8 @@ impl YaakUpdater {
|
|||||||
if h.dialog()
|
if h.dialog()
|
||||||
.message("Would you like to restart the app?")
|
.message("Would you like to restart the app?")
|
||||||
.title("Update Installed")
|
.title("Update Installed")
|
||||||
|
.ok_button_label("Restart")
|
||||||
|
.cancel_button_label("Later")
|
||||||
.blocking_show()
|
.blocking_show()
|
||||||
{
|
{
|
||||||
h.restart();
|
h.restart();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"frontendDist": "../dist"
|
"frontendDist": "../dist"
|
||||||
},
|
},
|
||||||
"productName": "Yaak",
|
"productName": "Yaak",
|
||||||
"version": "2024.4.0-beta.3",
|
"version": "2024.4.0-beta.2",
|
||||||
"identifier": "app.yaak.desktop",
|
"identifier": "app.yaak.desktop",
|
||||||
"app": {
|
"app": {
|
||||||
"withGlobalTauri": false,
|
"withGlobalTauri": false,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export const WorkspaceHeader = memo(function WorkspaceHeader({ className }: Prop
|
|||||||
<div className="pointer-events-none">
|
<div className="pointer-events-none">
|
||||||
<RecentRequestsDropdown />
|
<RecentRequestsDropdown />
|
||||||
</div>
|
</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 />
|
<ImportCurlButton />
|
||||||
<SettingsDropdown />
|
<SettingsDropdown />
|
||||||
{(osInfo?.osType === 'linux' || osInfo?.osType === 'windows') && (
|
{(osInfo?.osType === 'linux' || osInfo?.osType === 'windows') && (
|
||||||
|
|||||||
Reference in New Issue
Block a user