Make add-feed work again.

This commit is contained in:
Brent Simmons 2024-05-27 11:34:14 -07:00
parent 545ed4ad56
commit 9d747a99c9
1 changed files with 12 additions and 2 deletions

View File

@ -22,6 +22,7 @@ private final class IndeterminateProgressController {
static var windowController: IndeterminateProgressWindowController?
static var runningProgressWindow = false
static var modalSession: NSApplication.ModalSession?
static func beginProgressWithMessage(_ message: String) {
@ -32,7 +33,10 @@ private final class IndeterminateProgressController {
runningProgressWindow = true
windowController = IndeterminateProgressWindowController(message: message)
NSApplication.shared.runModal(for: windowController!.window!)
assert(modalSession == nil)
modalSession = NSApplication.shared.beginModalSession(for: windowController!.window!)
NSApplication.shared.runModalSession(modalSession!)
}
static func endProgress() {
@ -43,9 +47,15 @@ private final class IndeterminateProgressController {
}
runningProgressWindow = false
NSApplication.shared.stopModal()
if let modalSession {
NSApplication.shared.endModalSession(modalSession)
} else {
assertionFailure("endProgress called without a modalSession.")
}
windowController?.close()
windowController = nil
modalSession = nil
}
}