mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 14:26:01 +00:00
Automatically delete temporary files after file transfer
This commit is contained in:
1 parent
24a0202ae9
commit
733ed8bec8
2 files changed
+14
-3
No files matched your search
@@ -63,6 +63,18 @@ class OutboundNearbyConnection: NearbyConnection {
|
||||
override func disconnect() {
|
||||
super.disconnect()
|
||||
|
||||
// delete all files
|
||||
for url in urlsToSend {
|
||||
|
||||
do {
|
||||
try FileManager.default.removeItem(at: url)
|
||||
log("[OutboundNearbyConnection \(self.id)] Deleted file at \(url).")
|
||||
}
|
||||
catch {
|
||||
log("[OutboundNearbyConnection \(self.id)] Failed to delete file at \(url): \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
if let error = lastError {
|
||||
DispatchQueue.main.async {
|
||||
self.delegate?.failedWithError(connection: self, error: error)
|
||||
|
||||
Reference in new issue
Block a user