diff --git a/Shared/Account/AccountLoginView.swift b/Shared/Account/AccountLoginView.swift index c7ea5ea..64e7971 100644 --- a/Shared/Account/AccountLoginView.swift +++ b/Shared/Account/AccountLoginView.swift @@ -88,16 +88,6 @@ struct AccountLoginView: View { .padding() } } - .onChange(of: model.hasError) { value in - if value { - if let error = model.currentError { - self.errorHandling.handle(error: error) - } else { - self.errorHandling.handle(error: AppError.genericError) - } - model.hasError = false - } - } } } diff --git a/Shared/Account/AccountView.swift b/Shared/Account/AccountView.swift index 9241026..0a2546e 100644 --- a/Shared/Account/AccountView.swift +++ b/Shared/Account/AccountView.swift @@ -2,6 +2,7 @@ import SwiftUI struct AccountView: View { @EnvironmentObject var model: WriteFreelyModel + @EnvironmentObject var errorHandling: ErrorHandling var body: some View { if model.account.isLoggedIn { @@ -16,6 +17,17 @@ struct AccountView: View { .withErrorHandling() .padding(.top) } + EmptyView() + .onChange(of: model.hasError) { value in + if value { + if let error = model.currentError { + self.errorHandling.handle(error: error) + } else { + self.errorHandling.handle(error: AppError.genericError) + } + model.hasError = false + } + } } } diff --git a/iOS/Settings/SettingsView.swift b/iOS/Settings/SettingsView.swift index e64bc94..28c55a6 100644 --- a/iOS/Settings/SettingsView.swift +++ b/iOS/Settings/SettingsView.swift @@ -9,6 +9,7 @@ struct SettingsView: View { Form { Section(header: Text("Login Details")) { AccountView() + .withErrorHandling() } Section(header: Text("Appearance")) { PreferencesView(preferences: model.preferences)