Files
jarvis/Jarvis/JarvisApp.swift
Robin Kutesa feee58748c
Some checks failed
CI / Build · macos-14 · Debug (push) Has been cancelled
CI / Build · macos-15 · Debug (push) Has been cancelled
CI / Build · macos-14 · Release (push) Has been cancelled
CI / Build · macos-15 · Release (push) Has been cancelled
Sink seen/read stories, fix F1 matching, drop East Africa pill
- Sink already-seen and read stories to the bottom of the feed (new SeenStory
  model + per-load snapshot so order is stable while scrolling and refreshes
  sink what you've seen) so fresh content surfaces.
- F1 matching: clear F1 headline OR a majority of F1-feed sources, replacing the
  broad keyword list that leaked crypto in (fia -> "deFIAnt"). Dropped unused
  matchSources path.
- Remove the East Africa pill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 14:17:32 +03:00

58 lines
2.1 KiB
Swift

// JarvisApp.swift
import SwiftUI
import SwiftData
import UIKit
import BackgroundTasks
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// Register the briefing background-refresh handler before launch completes.
BGTaskScheduler.shared.register(forTaskWithIdentifier: jarvisBriefingRefreshID, using: nil) { task in
Task { @MainActor in
await NotificationManager.shared.applySettings()
NotificationManager.shared.scheduleBackgroundRefresh()
task.setTaskCompleted(success: true)
}
}
return true
}
}
@main
struct JarvisApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
@StateObject private var settings = ServerSettings.shared
@StateObject private var store = StoryStore.shared
@StateObject private var ws = WebSocketManager.shared
@StateObject private var connectivity = ConnectivitySettings.shared
@StateObject private var connManager = ConnectivityManager.shared
@StateObject private var notifications = NotificationManager.shared
var body: some Scene {
WindowGroup {
Group {
if settings.isConfigured {
RootTabView()
} else {
OnboardingView()
}
}
.environmentObject(settings)
.environmentObject(store)
.environmentObject(ws)
.environmentObject(connectivity)
.environmentObject(connManager)
.environmentObject(notifications)
.task {
connManager.start()
await connManager.resolveAndActivate()
await notifications.bootstrap()
}
}
.modelContainer(for: [CachedStory.self, CachedArticle.self, ReadStory.self,
SavedStory.self, SeenStory.self])
}
}