mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Convert restoreWindow to async await.
This commit is contained in:
parent
178cba34ad
commit
4b381daa92
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user