Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import AnytypeCore

struct ApplicationCoordinatorView: View {

@StateObject private var model = ApplicationCoordinatorViewModel()
@State private var model = ApplicationCoordinatorViewModel()
@Environment(\.dismissAllPresented) private var dismissAllPresented

var body: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@ import AnytypeCore
import Services

@MainActor
final class ApplicationCoordinatorViewModel: ObservableObject {
@Observable
final class ApplicationCoordinatorViewModel {

@Injected(\.authService)
@Injected(\.authService) @ObservationIgnored
private var authService: any AuthServiceProtocol
@Injected(\.accountEventHandler)
@Injected(\.accountEventHandler) @ObservationIgnored
private var accountEventHandler: any AccountEventHandlerProtocol
@Injected(\.encryptionKeyEventHandler)
@Injected(\.encryptionKeyEventHandler) @ObservationIgnored
private var encryptionKeyEventHandler: any EncryptionKeyEventHandlerProtocol
@Injected(\.applicationStateService)
@Injected(\.applicationStateService) @ObservationIgnored
private var applicationStateService: any ApplicationStateServiceProtocol
@Injected(\.accountManager)
@Injected(\.accountManager) @ObservationIgnored
private var accountManager: any AccountManagerProtocol
@Injected(\.seedService)
@Injected(\.seedService) @ObservationIgnored
private var seedService: any SeedServiceProtocol
@Injected(\.fileErrorEventHandler)
@Injected(\.fileErrorEventHandler) @ObservationIgnored
private var fileErrorEventHandler: any FileErrorEventHandlerProtocol
@Injected(\.basicUserInfoStorage)
@Injected(\.basicUserInfoStorage) @ObservationIgnored
private var basicUserInfoStorage: any BasicUserInfoStorageProtocol
@Injected(\.pushNotificationsPermissionService)
@Injected(\.pushNotificationsPermissionService) @ObservationIgnored
private var pushNotificationsPermissionService: any PushNotificationsPermissionServiceProtocol

@ObservationIgnored
private var dismissAllPresented: DismissAllPresented?

// MARK: - State

@Published var applicationState: ApplicationState = .initial
@Published var toastBarData: ToastBarData?
@Published var migrationData: MigrationModuleData?
@Published var selectAccountTaskId: String?
var applicationState: ApplicationState = .initial
var toastBarData: ToastBarData?
var migrationData: MigrationModuleData?
var selectAccountTaskId: String?

func deleteAccount() -> AnyView? {
if case let .pendingDeletion(deadline) = accountManager.account.status {
Expand Down