Properly wait for dismissal before presenting a new view controller#5977
Properly wait for dismissal before presenting a new view controller#5977ChronicLynx wants to merge 1 commit intosignalapp:mainfrom
Conversation
85f398e to
cded66d
Compare
| viewController.modalPresentationStyle = .fullScreen | ||
| zoomOut(animated: true) { [weak self] in | ||
| self?.presentFullScreen(viewController, animated: false) | ||
| self?.present(viewController, animated: false, completion: nil) |
There was a problem hiding this comment.
Especially since this isn't related to the fix, I'm more inclined to drop the viewController.modalPresentationStyle = .fullScreen here, and continue to call self.presentFullScreen here.
|
I'm not sure that this will fix the linked issues, but it seems like a reasonable change nonetheless. I can get this merged internally (and I can make the adjustment I left a comment about, while I'm there). Our flow for external contributions is to recreate the diff internally, and commit it using the external author's information. Would you mind emailing me at sasha@signal.org with a name and email you'd like used in the commit authorship? Thank you! |
|
This was merged internally as |
First time contributor checklist
Contributor checklist
Description
Potentially fixes #5976
My theory, given the error in #5976, is that because the original code failed to wait for the dismissal to complete, it would occasionally try to present a new view while an existing view was present. This caused the animation for the navigation buttons in ImageEditorCropViewController and similar image editing views to be left in a state with no bottom navigation buttons. Therefore, the user has to force quit the app in order to exit the view. I think this may stabilize that flow and prevent such situations from occurring.
ImageEditorCropViewController:
I would imagine when encountering the error
2025/02/20 00:54:25:091 ERR❤️ [AttachmentPrepViewController.swift:221 presentFullScreen(viewController:)]: Already has presented view controller. [<SignalUI.ImageEditorCropViewController: 0x127aef700>that it possibly short circuits or resets the logic responsible for summoning the bottom buttons. I was originally fixated on the logic summoning the buttons until I noticed a seemingly correlated error with the occurrence of the bug in AttachmentPrepViewController.