mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Use async await in runSheetOnWindow.
This commit is contained in:
@@ -10,8 +10,8 @@ import AppKit
|
|||||||
import Articles
|
import Articles
|
||||||
import Account
|
import Account
|
||||||
|
|
||||||
class AddFolderWindowController : NSWindowController {
|
final class AddFolderWindowController : NSWindowController {
|
||||||
|
|
||||||
@IBOutlet var folderNameTextField: NSTextField!
|
@IBOutlet var folderNameTextField: NSTextField!
|
||||||
@IBOutlet var accountPopupButton: NSPopUpButton!
|
@IBOutlet var accountPopupButton: NSPopUpButton!
|
||||||
@IBOutlet var addFolderButton: NSButton!
|
@IBOutlet var addFolderButton: NSButton!
|
||||||
@@ -25,9 +25,10 @@ class AddFolderWindowController : NSWindowController {
|
|||||||
|
|
||||||
func runSheetOnWindow(_ w: NSWindow) {
|
func runSheetOnWindow(_ w: NSWindow) {
|
||||||
hostWindow = w
|
hostWindow = w
|
||||||
hostWindow!.beginSheet(window!) { (returnCode: NSApplication.ModalResponse) -> Void in
|
|
||||||
|
Task { @MainActor in
|
||||||
if returnCode == NSApplication.ModalResponse.OK {
|
let returnCode = await hostWindow!.beginSheet(window!)
|
||||||
|
if returnCode == .OK {
|
||||||
self.addFolderIfNeeded()
|
self.addFolderIfNeeded()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user