From 965d9540fa22718e462b40f66a6edf6bf9b5a1ec Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 8 Mar 2026 22:11:35 +0100 Subject: [PATCH] fix: double sparkle update check --- lib/services/update_service.dart | 9 +++++---- macos/Runner/Info.plist | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/services/update_service.dart b/lib/services/update_service.dart index 5b3538ce..9c1301ec 100644 --- a/lib/services/update_service.dart +++ b/lib/services/update_service.dart @@ -45,12 +45,10 @@ class UpdateService { /// Call once at startup if [useNativeUpdater] is true. static Future initNativeUpdater() async { if (_nativeUpdaterInitialized) return; - _nativeUpdaterInitialized = true; try { await autoUpdater.setFeedURL(_feedUrl); - // 6 hours in seconds - await autoUpdater.setScheduledCheckInterval(_checkCooldown.inSeconds); + _nativeUpdaterInitialized = true; } catch (e) { _logger.e('Failed to initialize native auto updater: $e'); } @@ -59,7 +57,10 @@ class UpdateService { /// Trigger a background update check via Sparkle/WinSparkle. /// Only shows UI if an update is found. static Future checkForUpdatesNative({bool inBackground = true}) async { - if (!_nativeUpdaterInitialized) await initNativeUpdater(); + if (!_nativeUpdaterInitialized) { + await initNativeUpdater(); + if (!_nativeUpdaterInitialized) return; + } try { await autoUpdater.checkForUpdates(inBackground: inBackground); } catch (e) { diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist index b9238fc3..4b7d246c 100644 --- a/macos/Runner/Info.plist +++ b/macos/Runner/Info.plist @@ -30,6 +30,8 @@ NSApplication FLTEnableMergedPlatformUIThread + SUEnableAutomaticChecks + SUFeedURL https://github.com/edde746/plezy/releases/latest/download/appcast.xml SUPublicEDKey