@open-wa/wa-automate 4.71.6 → 4.71.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -100,8 +100,14 @@ function initPage(sessionId, config, qrManager, customUserAgent, spinner, _page,
100
100
  // const content = await frame.content() //not using content right now so save some ms by commenting out
101
101
  logging_1.log.info(`FRAME NAV DETECTED, ${frame.url()}, Reinjecting APIs...`);
102
102
  // there's no more webpack so reinject anyways
103
- frameNavPromises.push(injectApi(waPage, spinner, true));
104
- frameNavPromises.push(qrManager.waitFirstQr(waPage, config, spinner));
103
+ const hasWapi = yield waPage.evaluate("window.WAPI ? true : false");
104
+ if (!hasWapi) {
105
+ logging_1.log.info("FN: WAPI missing. Reinjecting APIs...");
106
+ frameNavPromises.push(injectApi(waPage, spinner, true));
107
+ frameNavPromises.push(qrManager.waitFirstQr(waPage, config, spinner));
108
+ }
109
+ else
110
+ logging_1.log.info("FN: WAPI intact. Skipping reinjection...");
105
111
  if (frame.url().includes('post_logout=1')) {
106
112
  console.log("Session most likely logged out");
107
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.71.6",
3
+ "version": "4.71.8",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",