fix test
This commit is contained in:
parent
9a5c14c58b
commit
68a3414761
|
|
@ -267,9 +267,9 @@ func main() {
|
||||||
},
|
},
|
||||||
Store: st,
|
Store: st,
|
||||||
ToolRegistry: toolRegistry,
|
ToolRegistry: toolRegistry,
|
||||||
Dev: devMode,
|
Dev: devMode,
|
||||||
Logger: slog.Default(),
|
Logger: slog.Default(),
|
||||||
Updater: upd,
|
Updater: upd,
|
||||||
UpdateAvailableFunc: func() {
|
UpdateAvailableFunc: func() {
|
||||||
UpdateAvailable("")
|
UpdateAvailable("")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -303,37 +303,37 @@ func (u *Updater) StartBackgroundUpdaterChecker(ctx context.Context, cb func(str
|
||||||
// Regular interval check
|
// Regular interval check
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always check for updates
|
// Always check for updates
|
||||||
available, resp := u.checkForUpdate(ctx)
|
available, resp := u.checkForUpdate(ctx)
|
||||||
if !available {
|
if !available {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is available - check if auto-update is enabled for downloading
|
// Update is available - check if auto-update is enabled for downloading
|
||||||
settings, err := u.Store.Settings()
|
settings, err := u.Store.Settings()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("failed to load settings", "error", err)
|
slog.Error("failed to load settings", "error", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !settings.AutoUpdateEnabled {
|
if !settings.AutoUpdateEnabled {
|
||||||
// Auto-update disabled - don't download, just log
|
// Auto-update disabled - don't download, just log
|
||||||
slog.Debug("update available but auto-update disabled", "version", resp.UpdateVersion)
|
slog.Debug("update available but auto-update disabled", "version", resp.UpdateVersion)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-update is enabled - download
|
// Auto-update is enabled - download
|
||||||
err = u.DownloadNewRelease(ctx, resp)
|
err = u.DownloadNewRelease(ctx, resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("failed to download new release", "error", err)
|
slog.Error("failed to download new release", "error", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download successful - show tray notification (regardless of toggle state)
|
// Download successful - show tray notification (regardless of toggle state)
|
||||||
err = cb(resp.UpdateVersion)
|
err = cb(resp.UpdateVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Warn("failed to register update available with tray", "error", err)
|
slog.Warn("failed to register update available with tray", "error", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue