macos: hook up proper data events

This commit is contained in:
Mitchell Hashimoto
2023-09-11 13:52:47 -07:00
parent 711e3a5043
commit 6f7fdf002f
2 changed files with 3 additions and 3 deletions

View File

@ -20,8 +20,8 @@ class ConfigurationErrorsController: NSWindowController, NSWindowDelegate {
shouldCascadeWindows = false
if let c = cancellable { c.cancel() }
cancellable = model.objectWillChange.sink {
if (self.model.errors.count == 0) {
cancellable = model.$errors.sink { newValue in
if (newValue.count == 0) {
self.window?.close()
}
}

View File

@ -5,7 +5,7 @@ struct ConfigurationErrorsView: View {
@Published var errors: [String] = []
}
var model: Model
@ObservedObject var model: Model
var body: some View {
VStack {