mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +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 {
|
||||
log("Stopped accessing security scoped resource.")
|
||||
url.stopAccessingSecurityScopedResource()
|
||||
self.securityScopeUrl = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,6 +394,12 @@ class InboundNearbyConnection: NearbyConnection{
|
||||
}
|
||||
|
||||
private func acceptTransfer(){
|
||||
|
||||
if currentState == .disconnected {
|
||||
log("Detected timeout, not accepting transfer")
|
||||
return
|
||||
}
|
||||
|
||||
do{
|
||||
for (id, file) in transferredFiles{
|
||||
FileManager.default.createFile(atPath: file.destinationURL.path, contents: nil)
|
||||
|
||||
Reference in new issue
Block a user