-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(admob): improve defense logic to prevent multiple calls #4849
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/hq6jrn4kz |
Codecov Report
@@ Coverage Diff @@
## master #4849 +/- ##
==========================================
+ Coverage 88.66% 89.06% +0.41%
==========================================
Files 109 109
Lines 3712 3720 +8
Branches 347 347
==========================================
+ Hits 3291 3313 +22
+ Misses 379 365 -14
Partials 42 42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it set loadCalled to false here as the event to set loaded == false is handled?
...I should add - thanks for the PR :-) |
Hey @ifsnow - I had a comment on this PR, can you take a look? |
@mikehardy Sorry for being late. If _handleAdEvent(event) {
const { type, error, data } = event.body;
...
if (type === AdEventType.CLOSED || type === RewardedAdEventType.CLOSED) {
this._loaded = false;
this._isLoadCalled = false; // <= here
}
....
} Let me know if this is what you said. I'll fix it right away. |
Yes! I think that's the spot. I'm not sure if it could happen but it seems better to match the states precisely? |
e46dbf2
to
b43b2b4
Compare
@mikehardy That's a good point. My commit was modified. Thanks! |
Great! @ifsnow last thing left is to sign the CLA so we can merge the change? You can follow the details link on the github actions check to do it - I think it's this https://cla-assistant.io/invertase/react-native-firebase?pullRequest=4849 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me!
@mikehardy Did it. Thanks |
v10.6.3 is newly published with this change 🚀 |
Description
loaded: Whether the advert is loaded and can be shown.
If
_loaded
is changed totrue
whenload()
is called, the meaning ofloaded
getter becomes ambiguous.If the goal is to prevent multiple calls, it would be better to use other variables for this.
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__