Skip to content

Commit

Permalink
[fix] fix enableLazyload (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosvlehmkuhl authored Jun 25, 2020
1 parent 526523d commit adf62ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 4 additions & 4 deletions js/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ const DFPManager = Object.assign(new EventEmitter().setMaxListeners(0), {
pubadsService.set(key, adSenseAttributes[key]);
});
if (this.lazyLoadIsEnabled()) {
const args = [];
const config = this.getLazyLoadConfig();
if (config !== null) {
args.push(config);
if (config) {
pubadsService.enableLazyLoad(config);
} else {
pubadsService.enableLazyLoad();
}
pubadsService.enableLazyLoad.call(args);
}
if (this.singleRequestIsEnabled()) {
pubadsService.enableSingleRequest();
Expand Down
10 changes: 4 additions & 6 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,13 @@ var DFPManager = Object.assign(new _events.EventEmitter().setMaxListeners(0), {
});

if (_this5.lazyLoadIsEnabled()) {
var args = [];

var config = _this5.getLazyLoadConfig();

if (config !== null) {
args.push(config);
if (config) {
pubadsService.enableLazyLoad(config);
} else {
pubadsService.enableLazyLoad();
}

pubadsService.enableLazyLoad.call(args);
}

if (_this5.singleRequestIsEnabled()) {
Expand Down

0 comments on commit adf62ed

Please sign in to comment.