Replace alert with toast view

This commit is contained in:
Leon Böttger committed 2026-02-07 15:15:26 +01:00
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? {