fix: use modelContext.container — \.modelContainer is not an Environment key
Some checks failed
CI / Build · Debug (push) Waiting to run
CI / Build · Release (push) Has been cancelled

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:
Kutesir
2026-07-05 16:09:32 +03:00
parent 5419540648
commit d62c3511f6

View File

@@ -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>())) ?? []