Page MenuHomeMusing Studio

MacPreferencesView.swift
No OneTemporary

MacPreferencesView.swift

import SwiftUI
struct MacPreferencesView: View {
@EnvironmentObject var model: WriteFreelyModel
@EnvironmentObject var errorHandling: ErrorHandling
@ObservedObject var preferences: PreferencesModel
var body: some View {
VStack {
PreferencesView(preferences: preferences)
Spacer()
}
.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 MacPreferencesView_Previews: PreviewProvider {
static var previews: some View {
MacPreferencesView(preferences: PreferencesModel())
}
}

File Metadata

Mime Type
text/x-c
Expires
Mon, Nov 25, 1:52 AM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3106495

Event Timeline