Move is_dev check for updates

This commit is contained in:
Gregory Schier
2024-05-16 10:28:25 -07:00
parent 57d548743f
commit 8606940dee

View File

@@ -1,7 +1,7 @@
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::time::SystemTime; use std::time::SystemTime;
use log::info; use log::{debug, info};
use tauri::AppHandle; use tauri::AppHandle;
use tauri_plugin_dialog::DialogExt; use tauri_plugin_dialog::DialogExt;
use tauri_plugin_updater::UpdaterExt; use tauri_plugin_updater::UpdaterExt;
@@ -53,13 +53,8 @@ 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(); info!("Checking for updates mode={}", mode);
info!("Checking for updates mode={} enabled={}", mode, enabled);
if !enabled {
return Ok(false);
}
let update_check_result = 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())?
@@ -121,6 +116,12 @@ impl YaakUpdater {
return Ok(false); return Ok(false);
} }
// Don't check if dev
if is_dev() {
debug!("Not checking for updates in dev");
return Ok(false);
}
self.force_check(app_handle, mode).await self.force_check(app_handle, mode).await
} }
} }