mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
93c016268a
* Add error handling to post editor
* Cleanup
* Add error handling to macOS (#211)
* Add error handling to Mac app
* Log fatal errors and present alert on next launch (#212)
* Log fatal crashes and present alert on next launch
* Update crash alert copy and navigate to help forum
* Refactor logging into reuseable methods
* Refactor class to use protocol
* Clean up todo comment
* Revert "Log fatal errors and present alert on next launch (#212)"
This reverts commit 7475b57772
.
30 lines
779 B
Swift
30 lines
779 B
Swift
import SwiftUI
|
|
|
|
struct MacAccountView: View {
|
|
@EnvironmentObject var model: WriteFreelyModel
|
|
@EnvironmentObject var errorHandling: ErrorHandling
|
|
|
|
var body: some View {
|
|
Form {
|
|
AccountView()
|
|
}
|
|
.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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct MacAccountView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
MacAccountView()
|
|
.environmentObject(WriteFreelyModel())
|
|
}
|
|
}
|