Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(macos): check for the waiting update once the App Store has the app

leepokai8e9611128b02
diff --git a/apps/macos/App/UpdatesManager.swift b/apps/macos/App/UpdatesManager.swift
index 8b58765f..e39c0d2f 100644
--- a/apps/macos/App/UpdatesManager.swift
+++ b/apps/macos/App/UpdatesManager.swift
@@ -71,13 +71,23 @@ final class UpdatesManager: NSObject, SPUUpdaterDelegate, @preconcurrency SPUSta
errorMessage = error.localizedDescription
}
gateTask = Task { [weak self] in
- while !Task.isCancelled {
- await self?.refreshGate()
- try? await Task.sleep(for: .seconds(6 * 3600))
+ while !Task.isCancelled, let interval = await self?.gateTick() {
+ try? await Task.sleep(for: interval)
}
}
}
+ /// Refreshes the gate; while waiting for the iPhone app it looks hourly and checks for the
+ /// update as soon as the App Store has it, instead of at the next daily check.
+ private func gateTick() async -> Duration {
+ await refreshGate()
+ if let required = waitingForApp, let store = appStoreVersion,
+ AppVersion.parse(store) != nil, !AppVersion.isBelow(store, required) {
+ controller?.updater.checkForUpdatesInBackground()
+ }
+ return .seconds(waitingForApp == nil ? 6 * 3600 : 3600)
+ }
+
private func refreshGate() async {
if let version = try? await AppStoreRelease.latestVersion() { appStoreVersion = version }
if let devices = try? await host?.store?.client?.devices() {