Fix share button not working for some users #5849
Open
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.
Fixes #5719
Why
This is one that I was unable to reproduce for some time, but was finally able to "accidentally" discover. If you press too long on the "share" button, the dialog actually ends up staying open a tad bit longer. It seems like when that happens, the app isn't able to present the share dialog because the menu sheet is still presented and animating away.
Notably here, we were not calling our menu item
onPress
inside of theclose()
function's callback, but rather in parallel. We've seen in the past where its pretty essential to do that, and it seems like this is another one of those cases.Test Plan
Before this PR, open the share sheet and take a bit longer on pressing the "Share" button. It shouldn't open the share sheet. Then, test this pr and do the same. It should still open.
Also worth checking other buttons like "Translate" to ensure they still work.