Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android][media-library] fix promise resolved twice #28323

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

mathieupost
Copy link
Contributor

Why

After #28212 was merged, the block in actionIfUserGrantedPermission was still executed even if permission was denied, resulting in the passed promise being resolved twice.

How

The block is now only evaluated if permission was granted.

Test Plan

By running the MediaLibrary tests in the bare-app, when rejecting the permission to modify assets, no log should appear about a promise being resolved twice.

Checklist

The block in actionIfUserGrantedPermission was still executed even if permission was denied, resulting in the passed promise being resolved twice.
@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Apr 19, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Apr 19, 2024
Copy link
Member

@tsapeta tsapeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks for fixing it!

@tsapeta tsapeta merged commit ea22360 into expo:main Apr 19, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants