From adf62edc497cc339c8e886cb35975ef93736925f Mon Sep 17 00:00:00 2001 From: marcosvlehmkuhl Date: Thu, 25 Jun 2020 08:51:21 -0300 Subject: [PATCH] [fix] fix enableLazyload (#194) --- js/manager.js | 8 ++++---- lib/manager.js | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js/manager.js b/js/manager.js index df54b90..af14a3c 100644 --- a/js/manager.js +++ b/js/manager.js @@ -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(); diff --git a/lib/manager.js b/lib/manager.js index 05ac54d..fca388c 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -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()) {