diff --git a/macos/Sources/Features/Settings/ConfigurationErrorsController.swift b/macos/Sources/Features/Settings/ConfigurationErrorsController.swift index 9956f7873..1dca58a1c 100644 --- a/macos/Sources/Features/Settings/ConfigurationErrorsController.swift +++ b/macos/Sources/Features/Settings/ConfigurationErrorsController.swift @@ -13,7 +13,15 @@ class ConfigurationErrorsController: NSWindowController, NSWindowDelegate, Confi @Published var errors: [String] = [] { didSet { if errors.count == 0 { - self.window?.performClose(nil) + // Only close the window if it was ever loaded: accessing + // `window` on an NSWindowController loads the nib (and our + // SwiftUI content view), which takes tens of milliseconds. + // This happens on every app launch via the initial config + // apply, when there are usually no errors and the window + // was never loaded. + if isWindowLoaded { + self.window?.performClose(nil) + } } } }