Skip to content

Commit

Permalink
always ensure displayAd fires, even during disableInitalLoad (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-thrillist authored Sep 24, 2020
1 parent 9c2c783 commit 52e6030
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
8 changes: 3 additions & 5 deletions js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ const DFPManager = Object.assign(new EventEmitter().setMaxListeners(0), {
this.configureOptions(googletag);
googletag.cmd.push(() => {
googletag.enableServices();
if (!this.disableInitialLoadIsEnabled()) {
slotsToInitialize.forEach((theSlotId) => {
googletag.display(theSlotId);
});
}
slotsToInitialize.forEach((theSlotId) => {
googletag.display(theSlotId);
});
resolve();
});
});
Expand Down
10 changes: 3 additions & 7 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,9 @@ var DFPManager = Object.assign(new _events.EventEmitter().setMaxListeners(0), {

googletag.cmd.push(function () {
googletag.enableServices();

if (!_this3.disableInitialLoadIsEnabled()) {
slotsToInitialize.forEach(function (theSlotId) {
googletag.display(theSlotId);
});
}

slotsToInitialize.forEach(function (theSlotId) {
googletag.display(theSlotId);
});
resolve();
});
});
Expand Down

0 comments on commit 52e6030

Please sign in to comment.