mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 05:46:03 +00:00
Always bring app in foreground if alerted
This commit is contained in:
1 parent
62d285364f
commit
65515eb2ce
1 file changed
+9
@@ -267,6 +267,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
}
|
}
|
||||||
|
|
||||||
func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) {
|
func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) {
|
||||||
|
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
activeIncomingTransfers[transfer.id] = TransferInfo(device: device, transfer: transfer)
|
activeIncomingTransfers[transfer.id] = TransferInfo(device: device, transfer: transfer)
|
||||||
|
|
||||||
AudioManager.playSound()
|
AudioManager.playSound()
|
||||||
@@ -363,8 +366,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
}
|
}
|
||||||
|
|
||||||
func showUnsupportedFileAlert(for device: RemoteDeviceInfo?) {
|
func showUnsupportedFileAlert(for device: RemoteDeviceInfo?) {
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
let alert = NSAlert()
|
let alert = NSAlert()
|
||||||
alert.alertStyle = .critical
|
alert.alertStyle = .critical
|
||||||
|
|
||||||
@@ -383,6 +389,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
|||||||
guard let transfer = activeIncomingTransfers[id] else { return }
|
guard let transfer = activeIncomingTransfers[id] else { return }
|
||||||
|
|
||||||
if let error = error {
|
if let error = error {
|
||||||
|
|
||||||
|
NSApp.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
var description = ""
|
var description = ""
|
||||||
|
|
||||||
if let ne = (error as? NearbyError) {
|
if let ne = (error as? NearbyError) {
|
||||||
|
|||||||
Reference in new issue
Block a user