From 68a3414761247592158f36eb83fc09a2cd62fd6b Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Mon, 5 Jan 2026 13:24:41 -0500 Subject: [PATCH] fix test --- app/cmd/app/app.go | 6 ++--- app/updater/updater.go | 54 +++++++++++++++++++++--------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/cmd/app/app.go b/app/cmd/app/app.go index 7bc73cd75..904807fd7 100644 --- a/app/cmd/app/app.go +++ b/app/cmd/app/app.go @@ -267,9 +267,9 @@ func main() { }, Store: st, ToolRegistry: toolRegistry, - Dev: devMode, - Logger: slog.Default(), - Updater: upd, + Dev: devMode, + Logger: slog.Default(), + Updater: upd, UpdateAvailableFunc: func() { UpdateAvailable("") }, diff --git a/app/updater/updater.go b/app/updater/updater.go index b29a4f83a..c5a2f2efa 100644 --- a/app/updater/updater.go +++ b/app/updater/updater.go @@ -303,37 +303,37 @@ func (u *Updater) StartBackgroundUpdaterChecker(ctx context.Context, cb func(str // Regular interval check } - // Always check for updates - available, resp := u.checkForUpdate(ctx) - if !available { - continue - } + // Always check for updates + available, resp := u.checkForUpdate(ctx) + if !available { + continue + } - // Update is available - check if auto-update is enabled for downloading - settings, err := u.Store.Settings() - if err != nil { - slog.Error("failed to load settings", "error", err) - continue - } + // Update is available - check if auto-update is enabled for downloading + settings, err := u.Store.Settings() + if err != nil { + slog.Error("failed to load settings", "error", err) + continue + } - if !settings.AutoUpdateEnabled { - // Auto-update disabled - don't download, just log - slog.Debug("update available but auto-update disabled", "version", resp.UpdateVersion) - continue - } + if !settings.AutoUpdateEnabled { + // Auto-update disabled - don't download, just log + slog.Debug("update available but auto-update disabled", "version", resp.UpdateVersion) + continue + } - // Auto-update is enabled - download - err = u.DownloadNewRelease(ctx, resp) - if err != nil { - slog.Error("failed to download new release", "error", err) - continue - } + // Auto-update is enabled - download + err = u.DownloadNewRelease(ctx, resp) + if err != nil { + slog.Error("failed to download new release", "error", err) + continue + } - // Download successful - show tray notification (regardless of toggle state) - err = cb(resp.UpdateVersion) - if err != nil { - slog.Warn("failed to register update available with tray", "error", err) - } + // Download successful - show tray notification (regardless of toggle state) + err = cb(resp.UpdateVersion) + if err != nil { + slog.Warn("failed to register update available with tray", "error", err) + } } }() }