macOS: Present errors as a sheet when applicable
This commit is contained in:
parent
ca5e90a70e
commit
c14e156926
|
@ -9,7 +9,15 @@ class ErrorPresenter: ErrorPresenterProtocol {
|
|||
alert.messageText = title
|
||||
alert.informativeText = message
|
||||
onPresented?()
|
||||
alert.runModal()
|
||||
onDismissal?()
|
||||
if let sourceVC = sourceVC as? NSViewController {
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
sourceVC.view.window!.makeKeyAndOrderFront(nil)
|
||||
alert.beginSheetModal(for: sourceVC.view.window!) { _ in
|
||||
onDismissal?()
|
||||
}
|
||||
} else {
|
||||
alert.runModal()
|
||||
onDismissal?()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue