mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 13:55:58 +00:00
Replace alert with toast view
This commit is contained in:
1 parent
b55d6ff07b
commit
ed20c9155e
9 files changed
+3311
-1270
No files matched your search
@@ -29,6 +29,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
private var tcpListener: NWListener
|
||||
private var mdnsServices: [NetService] = []
|
||||
private var incomingConnections: [String: InboundNearbyConnection] = [:]
|
||||
private var activeIncomingTransferID: String?
|
||||
private var foundServices: [String: FoundServiceInfo] = [:]
|
||||
private var outboundAppDelegates: [OutboundAppDelegate] = []
|
||||
private var inboundAppDelegates: [InboundAppDelegate] = []
|
||||
@@ -340,6 +341,9 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
|
||||
|
||||
func connectionWasTerminated(connection: InboundNearbyConnection, savedFiles: [URL], error: Error?) {
|
||||
if activeIncomingTransferID == connection.id {
|
||||
activeIncomingTransferID = nil
|
||||
}
|
||||
incomingConnections.removeValue(forKey: connection.id)
|
||||
|
||||
if !connection.wasUserRejected {
|
||||
@@ -481,6 +485,14 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
info.connection.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
func claimIncomingTransfer(id: String) -> Bool {
|
||||
if let activeIncomingTransferID, activeIncomingTransferID != id {
|
||||
return false
|
||||
}
|
||||
activeIncomingTransferID = id
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
private func endpointID(for service: NWBrowser.Result) -> String? {
|
||||
|
||||
Reference in new issue
Block a user