Skip to content

Commit cded66d

Browse files
committed
Properly wait for dismissal before presenting a new view controller
1 parent cbc9954 commit cded66d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

SignalUI/AttachmentApproval/AttachmentPrepViewController.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,15 @@ public class AttachmentPrepViewController: OWSViewController {
219219
private func presentFullScreen(viewController: UIViewController) {
220220
if let presentedViewController = presentedViewController {
221221
owsAssertDebug(false, "Already has presented view controller. [\(presentedViewController)]")
222-
presentedViewController.dismiss(animated: false)
222+
presentedViewController.dismiss(animated: false) { [weak self] in
223+
self?.presentFullScreen(viewController: viewController)
224+
}
225+
return
223226
}
224227

225228
viewController.modalPresentationStyle = .fullScreen
226229
zoomOut(animated: true) { [weak self] in
227-
self?.presentFullScreen(viewController, animated: false)
230+
self?.present(viewController, animated: false, completion: nil)
228231
}
229232
}
230233

0 commit comments

Comments
 (0)