mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
1 parent
0c1a158c32
commit
a43d812950
2 files changed
+7
-1
No files matched your search
@@ -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