mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +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 {
|
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
|
var mainWindow: NSWindow? = nil
|
||||||
if identifier.rawValue == WindowRestorationIdentifiers.mainWindow {
|
if identifier.rawValue == WindowRestorationIdentifiers.mainWindow {
|
||||||
mainWindow = appDelegate.createAndShowMainWindow().window
|
mainWindow = appDelegate.createAndShowMainWindow().window
|
||||||
}
|
}
|
||||||
completionHandler(mainWindow, nil)
|
return mainWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle Notification Actions
|
// Handle Notification Actions
|
||||||
|
Loading…
Reference in New Issue
Block a user