fix: Use @State instead of @StateObject for @Observable AppViewModel
- Replace @StateObject with @State for @Observable conformance - Remove unnecessary Task wrapper in init - Call loadSetupStatus() synchronously since it's already @MainActor
This commit is contained in:
parent
04de2c20d4
commit
31ed3fc0e1
@ -21,9 +21,7 @@ class AppViewModel {
|
||||
self.factory = factory
|
||||
setupNotificationObservers()
|
||||
|
||||
Task {
|
||||
await loadSetupStatus()
|
||||
}
|
||||
loadSetupStatus()
|
||||
}
|
||||
|
||||
private func setupNotificationObservers() {
|
||||
|
||||
@ -10,7 +10,7 @@ import netfox
|
||||
|
||||
@main
|
||||
struct readeckApp: App {
|
||||
@StateObject private var appViewModel = AppViewModel()
|
||||
@State private var appViewModel = AppViewModel()
|
||||
@StateObject private var appSettings = AppSettings()
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user