diff --git a/Shared/Account/AccountLogoutView.swift b/Shared/Account/AccountLogoutView.swift index 22df2da..d972f70 100644 --- a/Shared/Account/AccountLogoutView.swift +++ b/Shared/Account/AccountLogoutView.swift @@ -2,6 +2,7 @@ import SwiftUI struct AccountLogoutView: View { @EnvironmentObject var model: WriteFreelyModel + @EnvironmentObject var errorHandling: ErrorHandling @State private var isPresentingLogoutConfirmation: Bool = false @State private var editedPostsWarningString: String = "" @@ -66,7 +67,7 @@ struct AccountLogoutView: View { editedPostsWarningString = "You'll lose unpublished changes to \(editedPosts.count) edited posts. " } } catch { - print("Error: failed to fetch cached posts") + self.errorHandling.handle(error: LocalStoreError.couldNotFetchPosts("cached")) } self.isPresentingLogoutConfirmation = true } diff --git a/Shared/Account/AccountView.swift b/Shared/Account/AccountView.swift index 0a2546e..5843048 100644 --- a/Shared/Account/AccountView.swift +++ b/Shared/Account/AccountView.swift @@ -9,6 +9,7 @@ struct AccountView: View { HStack { Spacer() AccountLogoutView() + .withErrorHandling() Spacer() } .padding()