macOS: If a sheet is being shown, ignore quit and bring window to front
Otherwise, the 'exiting with an active tunnel' alert could get queued up to be shown after the current sheet is dismissed.
This commit is contained in:
parent
c714e424dc
commit
b5025b51cd
|
@ -44,6 +44,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func quit() {
|
@objc func quit() {
|
||||||
|
if let manageWindow = manageTunnelsWindowObject, manageWindow.attachedSheet != nil {
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
manageWindow.orderFront(self)
|
||||||
|
return
|
||||||
|
}
|
||||||
registerLoginItem(shouldLaunchAtLogin: false)
|
registerLoginItem(shouldLaunchAtLogin: false)
|
||||||
guard let currentTunnel = tunnelsTracker?.currentTunnel, currentTunnel.status == .active || currentTunnel.status == .activating else {
|
guard let currentTunnel = tunnelsTracker?.currentTunnel, currentTunnel.status == .active || currentTunnel.status == .activating else {
|
||||||
NSApp.terminate(nil)
|
NSApp.terminate(nil)
|
||||||
|
|
Loading…
Reference in New Issue