Restore smart settings and sync watch favourites

This commit is contained in:
FuelBoard Contributor
2026-08-30 18:57:57 +01:00
parent 0997dcea45
commit ebda21436d
11 changed files with 405 additions and 3 deletions
+9
View File
@@ -1,9 +1,12 @@
import ActivityKit
import BackgroundTasks
import SwiftUI
@main
struct FuelBoardApp: App {
init() {
WatchSyncManager.shared.activate()
SmartDataRefreshScheduler.register()
#if DEBUG
// QA hook (Debug builds only): `-qaLiveActivity e10|e5|diesel` starts a
// Live Activity with a long station name so the Lock Screen / island
@@ -21,6 +24,12 @@ struct FuelBoardApp: App {
WindowGroup {
ContentView()
.onOpenURL(perform: handleOpenURL)
.onReceive(NotificationCenter.default.publisher(for: .fuelBoardWatchRefreshRequested)) { _ in
WatchSyncManager.shared.pushSnapshot()
}
}
.backgroundTask(.appRefresh(SmartDataRefreshScheduler.taskIdentifier)) {
await SmartDataRefreshCoordinator.runBackgroundProbe()
}
}