Always bring app in foreground if alerted

This commit is contained in:
Leon Böttger committed 2025-05-17 15:08:03 +02:00
1 parent 62d285364f
commit 65515eb2ce
1 file changed
+9
+9
View File
@@ -267,6 +267,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
}
func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) {
NSApp.activate(ignoringOtherApps: true)
activeIncomingTransfers[transfer.id] = TransferInfo(device: device, transfer: transfer)
AudioManager.playSound()
@@ -363,8 +366,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
}
func showUnsupportedFileAlert(for device: RemoteDeviceInfo?) {
DispatchQueue.main.async {
NSApp.activate(ignoringOtherApps: true)
let alert = NSAlert()
alert.alertStyle = .critical
@@ -383,6 +389,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
guard let transfer = activeIncomingTransfers[id] else { return }
if let error = error {
NSApp.activate(ignoringOtherApps: true)
var description = ""
if let ne = (error as? NearbyError) {