@miso.ai/client-sdk-core 1.8.1-beta.5 → 1.8.1-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -114,7 +114,8 @@ class ApiHelpers {
114
114
  if (method && method !== 'POST') {
115
115
  throw new Error(`Non-POST API is not supported in useBeacon mode: ${url}`);
116
116
  }
117
- if (!(this._root._customSendBeacon || window.navigator.sendBeacon)(url, JSON.stringify(payload))) {
117
+ const successful = this._root._customSendBeacon ? this._root._customSendBeacon(url, JSON.stringify(payload)) : window.navigator.sendBeacon(url, JSON.stringify(payload));
118
+ if (!successful) {
118
119
  throw new Error(`Send beacon unsuccessful: ${url}`);
119
120
  }
120
121
  }
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = '1.8.1-beta.5';
7
+ var _default = '1.8.1-beta.7';
8
8
  exports.default = _default;
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "url": "https://github.com/MisoAI/miso-client-js-sdk/issues"
30
30
  },
31
31
  "dependencies": {
32
- "@miso.ai/commons": "1.8.1-beta.5"
32
+ "@miso.ai/commons": "1.8.1-beta.7"
33
33
  },
34
- "version": "1.8.1-beta.5"
34
+ "version": "1.8.1-beta.7"
35
35
  }
@@ -83,7 +83,10 @@ export default class ApiHelpers {
83
83
  if (method && method !== 'POST') {
84
84
  throw new Error(`Non-POST API is not supported in useBeacon mode: ${url}`);
85
85
  }
86
- if (!((this._root._customSendBeacon || window.navigator.sendBeacon)(url, JSON.stringify(payload)))) {
86
+ const successful = this._root._customSendBeacon ?
87
+ this._root._customSendBeacon(url, JSON.stringify(payload)) :
88
+ window.navigator.sendBeacon(url, JSON.stringify(payload));
89
+ if (!successful) {
87
90
  throw new Error(`Send beacon unsuccessful: ${url}`);
88
91
  }
89
92
  }
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.8.1-beta.5';
1
+ export default '1.8.1-beta.7';