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

View file

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