From 6f7fdf002f9a89adcf7a35daca09af28f4f98644 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 11 Sep 2023 13:52:47 -0700 Subject: [PATCH] macos: hook up proper data events --- .../Features/Settings/ConfigurationErrorsController.swift | 4 ++-- macos/Sources/Features/Settings/ConfigurationErrorsView.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/macos/Sources/Features/Settings/ConfigurationErrorsController.swift b/macos/Sources/Features/Settings/ConfigurationErrorsController.swift index 6e7a809cb..9e4b2a185 100644 --- a/macos/Sources/Features/Settings/ConfigurationErrorsController.swift +++ b/macos/Sources/Features/Settings/ConfigurationErrorsController.swift @@ -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() } } diff --git a/macos/Sources/Features/Settings/ConfigurationErrorsView.swift b/macos/Sources/Features/Settings/ConfigurationErrorsView.swift index 212354597..7d3aa4d83 100644 --- a/macos/Sources/Features/Settings/ConfigurationErrorsView.swift +++ b/macos/Sources/Features/Settings/ConfigurationErrorsView.swift @@ -5,7 +5,7 @@ struct ConfigurationErrorsView: View { @Published var errors: [String] = [] } - var model: Model + @ObservedObject var model: Model var body: some View { VStack {