You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integrating the SEAFile ActivityViewController in my app, I am trying to properly handle the case where the user hits the "Cancel" button in the SEAFile VC - so that I can unwind any preparation done prior to sharing.
The following code is used:
// Make the activityViewContoller which shows the share-view
let shareViewController = UIActivityViewController(activityItems: filesToShare, applicationActivities: nil)
// Show the share-view
self.present(shareViewController, animated: true, completion: {
// print("Activity finished...")
})
shareViewController.completionWithItemsHandler = { activity, completed, items, error in
if !completed {
// handle task not completed, put the original file back in place ..
let _ = FileManager.default.secureMoveItem(at: destinationFileURL, to: sourceFileURL)
print("Restored database file from: " + destinationFileURL.absoluteString + " back to: " + sourceFileURL.absoluteString)
return
}
else {
if (activity != nil) {
self.createEmptyDB()
}
}
self.updateUI()
}
}
The trouble is, "completed" is always true - even if the user cancels, and activity is always "com.seafile.seafilePro.SeafAction", so it cannot be checked for .. meaning that no matter if the user cancels the SEAFile upload, the "self.createEmptyDB()" function is called.
Seems to me this is a bug in SEAFile ActivityView - it should not return an activity if the user cancels, but I am not sure. Can other devs check this code and see if I'm missing something - otherwise, seems like a bug in SEAFile.
The text was updated successfully, but these errors were encountered:
Integrating the SEAFile ActivityViewController in my app, I am trying to properly handle the case where the user hits the "Cancel" button in the SEAFile VC - so that I can unwind any preparation done prior to sharing.
The following code is used:
The trouble is, "completed" is always true - even if the user cancels, and activity is always "com.seafile.seafilePro.SeafAction", so it cannot be checked for .. meaning that no matter if the user cancels the SEAFile upload, the "self.createEmptyDB()" function is called.
Seems to me this is a bug in SEAFile ActivityView - it should not return an activity if the user cancels, but I am not sure. Can other devs check this code and see if I'm missing something - otherwise, seems like a bug in SEAFile.
The text was updated successfully, but these errors were encountered: