mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-21 05:46:03 +00:00
Do not accept incoming transfer if already disconnected
This commit is contained in:
1 parent
ca571096bc
commit
867bf3fff5
1 file changed
+7
@@ -47,6 +47,7 @@ class InboundNearbyConnection: NearbyConnection{
|
|||||||
if let url = self.securityScopeUrl {
|
if let url = self.securityScopeUrl {
|
||||||
log("Stopped accessing security scoped resource.")
|
log("Stopped accessing security scoped resource.")
|
||||||
url.stopAccessingSecurityScopedResource()
|
url.stopAccessingSecurityScopedResource()
|
||||||
|
self.securityScopeUrl = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,6 +394,12 @@ class InboundNearbyConnection: NearbyConnection{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func acceptTransfer(){
|
private func acceptTransfer(){
|
||||||
|
|
||||||
|
if currentState == .disconnected {
|
||||||
|
log("Detected timeout, not accepting transfer")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
do{
|
do{
|
||||||
for (id, file) in transferredFiles{
|
for (id, file) in transferredFiles{
|
||||||
FileManager.default.createFile(atPath: file.destinationURL.path, contents: nil)
|
FileManager.default.createFile(atPath: file.destinationURL.path, contents: nil)
|
||||||
|
|||||||
Reference in new issue
Block a user