fix: invalid dismissCount value when closing modals #1531
Merged
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.
Description
Fixes #1473
When modals are pushed onto the stack, in view hierarchy they end up not being descendants of
RNSScreenNavigationController
-> When a modal is dismissed & we askRNSScreen
with modal view for its navigation controller ([self navigationController]
) we receive null. This causedgetIndexOfView:
method to return-1
(as the view was not found) what resulted in wrong value of_dismissCount
.Changes
Added a check for case when
navigationController
ofRNSScreen
is null - now in such case we default to_dismissCount == 1
Screenshots / GIFs
Before
Screen.Recording.2022-07-18.at.12.47.41.mov
After
Screen.Recording.2022-07-18.at.12.46.22.mov
Test code and steps to reproduce
Test1473
in test example apps.Checklist