From accccf8c8017d9703fab5cfa512e01bdbd82fff6 Mon Sep 17 00:00:00 2001 From: "Shivam@RS" Date: Thu, 26 Nov 2020 16:50:17 +0530 Subject: [PATCH] pendo-sdk/added debug option --- integrations/Pendo/browser.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/integrations/Pendo/browser.js b/integrations/Pendo/browser.js index 01629e6c3f..01110308b5 100644 --- a/integrations/Pendo/browser.js +++ b/integrations/Pendo/browser.js @@ -37,7 +37,15 @@ class Pendo { })(window, document, "script", "pendo"); })(this.apiKey); logger.debug("===in init Pendo==="); - window.pendo.initialize(); + this.setIntervalHandler = setInterval(this.handleDebugger.bind(this), 1000); + } + + handleDebugger() { + if (window.pendo.isReady && window.pendo.isReady()) { + // eslint-disable-next-line no-unused-expressions + this.isDebugMode ? this.enableDebugging() : this.disableDebugging(); + clearInterval(this.setIntervalHandler); + } } /* utility functions ---Start here --- */