From 4b381daa92a6efc6c3782819d90ea52e65e991dc Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 5 May 2024 16:49:49 -0700 Subject: [PATCH] Convert restoreWindow to async await. --- Mac/AppDelegate.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 462d0fc02..eab8e5bfe 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -980,14 +980,14 @@ extension AppDelegate : ScriptingAppDelegate { extension AppDelegate: NSWindowRestoration { - @objc static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder, completionHandler: @escaping (NSWindow?, Error?) -> Void) { + @objc static func restoreWindow(withIdentifier identifier: NSUserInterfaceItemIdentifier, state: NSCoder) async throws -> NSWindow { + var mainWindow: NSWindow? = nil if identifier.rawValue == WindowRestorationIdentifiers.mainWindow { mainWindow = appDelegate.createAndShowMainWindow().window } - completionHandler(mainWindow, nil) - } - + return mainWindow + } } // Handle Notification Actions