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

fix: setting currentPurchaseError to undefined on useIAP hook unmount #2740

Merged

Conversation

MuhammadRafeh
Copy link
Contributor

@MuhammadRafeh MuhammadRafeh commented May 11, 2024

This PR sets currentPurchaseError to undefined when useIAP hook gets unmount.

It's very important because when user first time goes to subscription screen and there is a useIAP hook and user try to purchase and fail then we get error. But user when again come backs to this screen then that currentPurchaseError value must be undefined but it's not undefined so this is a problem and I address this thing in this PR.

For Example: (Steps)

  • "A" Screen has useIAP hook
  • User comes to "A" Screen
  • Try to purchase and Gets error
  • Then user goes back and Come again to this screen
  • Then user sees error because currentPurchaseError has still some value (So, we need to get this undefined each time when useIAP get unmount)

Conclusion: It makes sense that currentPurchaseError should be undefined on hook unmount.

@MuhammadRafeh MuhammadRafeh changed the title fix: setting setCurrentPurchaseError to undefined on hook unmount fix: setting currentPurchaseError to undefined on useIAP hook unmount May 11, 2024
@hyochan hyochan force-pushed the fix/current-purchase-error branch from 3eba720 to 5e0baa6 Compare May 23, 2024 07:21
Copy link
Member

@hyochan hyochan left a comment

Choose a reason for hiding this comment

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

LGTM!

@hyochan hyochan added the 🛠 bugfix All kinds of bug fixes label May 23, 2024
@hyochan hyochan merged commit f94e809 into dooboolab-community:main May 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 bugfix All kinds of bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants