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

feat(hooks)!: automatically set isLoaded to false #199

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/displaying-ads-hook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Return values of the hook are:

| Name | Type | Description |
| :------------- | :--------------------------------- | :----------------------------------------------------------------------------------------------------------------- |
| isLoaded | boolean | Whether the ad is loaded and ready to to be shown to the user. |
| isLoaded | boolean | Whether the ad is loaded and ready to to be shown to the user. Automatically set to false when the ad is opened. |
jeremyhalin marked this conversation as resolved.
Show resolved Hide resolved
| isOpened | boolean | Whether the ad is opened. The value is remained `true` even after the ad is closed unless **new ad is requested**. |
| isClosed | boolean | Whether your ad is dismissed. |
| isShowing | boolean | Whether your ad is showing. The value is equal with `isOpened && !isClosed`. |
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useFullScreenAd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function useFullScreenAd<
setState({ isLoaded: true });
break;
case AdEventType.OPENED:
setState({ isOpened: true });
setState({ isOpened: true, isLoaded: false });
jeremyhalin marked this conversation as resolved.
Show resolved Hide resolved
break;
case AdEventType.CLOSED:
setState({ isClosed: true });
Expand Down