Watch: what changed on Recent cards and the thread screen, search in All threads, a switching complication with Allow and Deny in the Smart Stack, and question options on notifications

This commit is contained in:
gib committed 2026-11-02 13:56:10 -05:00
1 parent f8241e42bb
commit bfcbb69550
29 files changed
+1100 -137

No files matched your search

+8 -1
View File
@@ -1,6 +1,7 @@
// What the app tells the complication besides the credentials: whether it is in demo mode, and the
// last summary it saw, which the complication shows when it cannot reach the gateway. Both live in
// the shared Keychain group next to the device token, the one store the two processes share.
// the shared Keychain group next to the device token, the one store the two processes share. `api`
// is the gateway the complication and its Allow and Deny buttons call.
import Foundation
@@ -14,6 +15,12 @@ enum SharedState {
set { DeviceStore.setSharedData(newValue ? Data([1]) : nil, account: demoAccount) }
}
/// The demo gateway in demo mode, the paired gateway otherwise, and nil when not paired.
static var api: (any GatewayAPI)? {
if demo { return DemoGateway.shared }
return DeviceStore.load().map { GatewayClient(baseURL: $0.gatewayURL, token: $0.token) }
}
/// The last summary the app or the complication saw, or nil after signing out.
static var lastSummary: Summary? {
get { DeviceStore.sharedData(summaryAccount).flatMap { try? JSON.decoder().decode(Summary.self, from: $0) } }