mirror of
https://github.com/grishka/NearDrop.git
synced 2026-04-03 01:36:15 +02:00
@@ -23,6 +23,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
statusItem=NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||
statusItem?.button?.image=NSImage(named: "MenuBarIcon")
|
||||
statusItem?.menu=menu
|
||||
statusItem?.behavior = .removalAllowed
|
||||
|
||||
let nc=UNUserNotificationCenter.current()
|
||||
nc.requestAuthorization(options: [.alert, .sound]) { granted, err in
|
||||
@@ -39,6 +40,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
NearbyConnectionManager.shared.mainAppDelegate=self
|
||||
NearbyConnectionManager.shared.becomeVisible()
|
||||
}
|
||||
|
||||
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||
statusItem?.isVisible=true
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
|
||||
|
||||
@@ -349,7 +349,7 @@ class InboundNearbyConnection: NearbyConnection{
|
||||
currentState = .receivingFiles
|
||||
try sendTransferSetupFrame(frame)
|
||||
}catch{
|
||||
print("Error \(error)")
|
||||
lastError=error
|
||||
protocolError()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user