mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Handle errors on logout
This commit is contained in:
parent
01ba57ae75
commit
bf35738957
@ -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
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ struct AccountView: View {
|
||||
HStack {
|
||||
Spacer()
|
||||
AccountLogoutView()
|
||||
.withErrorHandling()
|
||||
Spacer()
|
||||
}
|
||||
.padding()
|
||||
|
Loading…
Reference in New Issue
Block a user