Skip to content

Commit

Permalink
fix(admob): AdEventHandler returns javascript (not native) unsubscrib…
Browse files Browse the repository at this point in the history
…e function (#4920)

* [bug] Admob listener wrong unsibscribe function

`_setAdEventHandler` method return a wrong unsubscribe function. It should remove js listener, but instead it unsubscribe ad instance from native events and _onAdEventHandler is still could be used by the instance

* fix(AdMob): fix linter error
  • Loading branch information
anta-semenov committed Feb 19, 2021
1 parent d6f52ca commit bff9dec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/admob/lib/ads/MobileAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class MobileAd {

_setAdEventHandler(handler) {
this._onAdEventHandler = handler;
return () => this._nativeListener.remove();
return () => (this._onAdEventHandler = null);
}

get adUnitId() {
Expand Down

1 comment on commit bff9dec

@vercel
Copy link

@vercel vercel bot commented on bff9dec Feb 19, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.