fix: use modelContext.container — \.modelContainer is not an Environment key
CI caught this: the sync-lag fix referenced a nonexistent SwiftUI environment value. The container is reached through the context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,6 @@ struct SignalFeedView: View {
|
||||
@EnvironmentObject var ws: WebSocketManager
|
||||
@EnvironmentObject var settings: ServerSettings
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
@Environment(\.modelContainer) private var modelContainer
|
||||
|
||||
@Query private var cachedStories: [CachedStory]
|
||||
@Query private var cachedArticles: [CachedArticle]
|
||||
@@ -724,7 +723,7 @@ struct SignalFeedView: View {
|
||||
|
||||
private func cacheStories(_ stories: [StorySummary]) {
|
||||
guard !stories.isEmpty else { return }
|
||||
let container = modelContainer
|
||||
let container = modelContext.container
|
||||
Task.detached {
|
||||
let ctx = ModelContext(container)
|
||||
let existing = (try? ctx.fetch(FetchDescriptor<CachedStory>())) ?? []
|
||||
|
||||
Reference in New Issue
Block a user