Prevent double dismiss

This commit is contained in:
Justin Mazzocchi 2021-03-04 23:22:21 -08:00
parent 27213a78f4
commit 7ff10d999e
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
1 changed files with 9 additions and 6 deletions

View File

@ -109,21 +109,24 @@ extension NewStatusViewController {
extension NewStatusViewController: PHPickerViewControllerDelegate { extension NewStatusViewController: PHPickerViewControllerDelegate {
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
mediaSelections.send(results) dismiss(animated: true) {
dismiss(animated: true) self.mediaSelections.send(results)
}
} }
} }
extension NewStatusViewController: UIImagePickerControllerDelegate { extension NewStatusViewController: UIImagePickerControllerDelegate {
func imagePickerController(_ picker: UIImagePickerController, func imagePickerController(_ picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) {
imagePickerResults.send(info) dismiss(animated: true) {
dismiss(animated: true) self.imagePickerResults.send(info)
}
} }
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
imagePickerResults.send(nil) dismiss(animated: true) {
dismiss(animated: true) self.imagePickerResults.send(nil)
}
} }
} }