[FIX] Modal freezing app after return from the background#4788
Closed
reinaldonetof wants to merge 3 commits intodevelopfrom
Closed
[FIX] Modal freezing app after return from the background#4788reinaldonetof wants to merge 3 commits intodevelopfrom
reinaldonetof wants to merge 3 commits intodevelopfrom
Conversation
dnlsilva
suggested changes
Jan 2, 2023
Contributor
dnlsilva
left a comment
There was a problem hiding this comment.
Wouldn't it be simpler to just disappear the modal before opening the link?
Contributor
Author
yeap, but you need to keep in mind that if you minimize the app, then reopen it again, will freeze the app too. So, the flow to freeze the app isn't only when clicking on the link. |
diegolmello
requested changes
Jan 4, 2023
| return true; | ||
| } | ||
| if (appState !== nextProps.appState) { | ||
| if (appState === 'background' && showAnnouncementModal) { |
Member
There was a problem hiding this comment.
We shouldn't do this.
It's going to be a mess to remove it later.
What if you just hide the modal before going background?
Contributor
Author
|
The pr #4795 is fixing this issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
This issue was found the first time when the user opened the announcement and the announcement's text is a link. Then the user pressed the link and should open the web browser outside of the app. This behavior was forcing the app to go to the background, then when the user resume the app again and tried to close the modal, the app was freezing. This is a known behavior when using a modal as you can see here: facebook/react-native#32504
However, to do a workaround in this case, we aren't re-render the RoomView at the exact time that the app goes to the background, although we are forced to close the modal when resuming the app again and calling the observable again to the list's query.
Issue(s)
How to test or reproduce
Screenshots
Before
Screen.Recording.2022-12-30.at.18.53.51.mov
Screen.Recording.2022-12-30.at.18.54.32.mov
After
Screen.Recording.2022-12-30.at.18.52.44.mov
Types of changes
Checklist
Further comments
TC-340