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

Ton of MI updates #26

Merged
merged 2 commits into from
May 3, 2022
Merged
Changes from 1 commit
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
13 changes: 10 additions & 3 deletions src/Bling.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable react/sort-comp */
import React, {Component} from "react";
import React, {Component, Fragment} from "react";
import PropTypes from "prop-types";
import ReactDOM from "react-dom";
import {debounce} from "throttle-debounce";
Expand Down Expand Up @@ -642,7 +642,8 @@ class Bling extends Component {
if (outOfPage) {
this._adSlot = Bling._adManager.googletag.defineOutOfPageSlot(
adUnitPath,
divId
Bling._adManager.googletag.enums.OutOfPageFormat
.INTERSTITIAL
andrew-sotiriou marked this conversation as resolved.
Show resolved Hide resolved
);
} else {
this._adSlot = Bling._adManager.googletag.defineSlot(
Expand Down Expand Up @@ -732,7 +733,9 @@ class Bling extends Component {
) {
Bling._adManager.updateCorrelator();
}
Bling._adManager.googletag.display(divId);
if (!this.props.outOfPage) {
Bling._adManager.googletag.display(divId);
}
if (
Bling._adManager._disableInitialLoad &&
!Bling._adManager._initialRender
Expand Down Expand Up @@ -797,6 +800,10 @@ class Bling extends Component {
this._adSlot = null;
}
this._divId = id || Bling._adManager.generateDivId();

if (this.props.outOfPage) {
return <Fragment />;
andrew-sotiriou marked this conversation as resolved.
Show resolved Hide resolved
}

return <div id={this._divId} style={style} />;
}
Expand Down