From 8606940dee080d5e62187cef18e88c3efcbf49ff Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 16 May 2024 10:28:25 -0700 Subject: [PATCH] Move is_dev check for updates --- src-tauri/src/updates.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/updates.rs b/src-tauri/src/updates.rs index e65c25ab..2b75e58f 100644 --- a/src-tauri/src/updates.rs +++ b/src-tauri/src/updates.rs @@ -1,7 +1,7 @@ use std::fmt::{Display, Formatter}; use std::time::SystemTime; -use log::info; +use log::{debug, info}; use tauri::AppHandle; use tauri_plugin_dialog::DialogExt; use tauri_plugin_updater::UpdaterExt; @@ -53,13 +53,8 @@ impl YaakUpdater { ) -> Result { self.last_update_check = SystemTime::now(); - let enabled = !is_dev(); - info!("Checking for updates mode={} enabled={}", mode, enabled); + info!("Checking for updates mode={}", mode); - if !enabled { - return Ok(false); - } - let update_check_result = app_handle .updater_builder() .header("X-Update-Mode", mode.to_string())? @@ -121,6 +116,12 @@ impl YaakUpdater { 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 } }