@saasquatch/squatch-js 2.5.1-4 → 2.5.1-5

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.5.1] - 2023-06-07
11
+
12
+ ### Fixed
13
+
14
+ - Race condition with auto-popup fixed when using the squatch-js package from NPM or on Safari
15
+
10
16
  ## [2.5.0] - 2023-05-16
11
17
 
12
18
  ### Removed
@@ -30,7 +36,7 @@ var initObj = {
30
36
  squatch
31
37
  .widget(initObj)
32
38
  .then(function (response) {
33
- const widget = response.widget
39
+ const widget = response.widget;
34
40
  })
35
41
  .catch(function (error) {
36
42
  console.log(error);
@@ -44,6 +50,7 @@ squatch
44
50
  ## [2.4.3] - 2023-04-20
45
51
 
46
52
  ### Changed
53
+
47
54
  - Updated license copyright to be in line with SaaSquatch open-source policy.
48
55
 
49
56
  ## [2.4.2] - 2023-04-10
@@ -287,8 +294,9 @@ No release notes.
287
294
 
288
295
  No release notes.
289
296
 
290
- [unreleased]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.5.0...HEAD
291
- [2.5.0]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.1...@saasquatch%2Fsquatch-js@2.5.0
297
+ [unreleased]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.5.1...HEAD
298
+ [2.5.1]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.5.0...@saasquatch%2Fsquatch-js@2.5.1
299
+ [2.5.0]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.3...@saasquatch%2Fsquatch-js@2.5.0
292
300
  [2.4.3]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.2...@saasquatch%2Fsquatch-js@2.4.3
293
301
  [2.4.2]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.1...@saasquatch%2Fsquatch-js@2.4.2
294
302
  [2.4.1]: https://github.com/saasquatch/squatch-js/compare/@saasquatch%2Fsquatch-js@2.4.0...@saasquatch%2Fsquatch-js@2.4.1
@@ -1599,21 +1599,21 @@ function _validateTrackOptions(raw) {
1599
1599
 
1600
1600
  /** @hidden */
1601
1601
  function asyncLoad() {
1602
+ var _window$squatch;
1603
+
1602
1604
  const loaded = window.squatch || null;
1603
1605
  const cached = window._squatch || null;
1606
+ const auto = (_window$squatch = window.squatch) == null ? void 0 : _window$squatch._auto;
1607
+ console.log({
1608
+ loaded,
1609
+ cached,
1610
+ auto
1611
+ });
1604
1612
 
1605
- function auto() {
1606
- setTimeout(() => {
1607
- if (typeof window.squatch._auto !== "function") return auto();
1608
-
1609
- window.squatch._auto();
1610
- }, 0);
1611
- }
1612
-
1613
- if (loaded && cached) {
1613
+ if (loaded && cached && auto) {
1614
1614
  const ready = cached.ready || [];
1615
1615
  ready.forEach(cb => setTimeout(() => cb(), 0));
1616
- auto(); // @ts-ignore -- intetionally deletes `_squatch` to cleanup initialization
1616
+ setTimeout(() => auto(), 0); // @ts-ignore -- intetionally deletes `_squatch` to cleanup initialization
1617
1617
 
1618
1618
  window._squatch = undefined;
1619
1619
 
package/dist/squatch.js CHANGED
@@ -1626,21 +1626,21 @@ function _validateTrackOptions(raw) {
1626
1626
 
1627
1627
  /** @hidden */
1628
1628
  function asyncLoad() {
1629
+ var _window$squatch;
1630
+
1629
1631
  const loaded = window.squatch || null;
1630
1632
  const cached = window._squatch || null;
1633
+ const auto = (_window$squatch = window.squatch) == null ? void 0 : _window$squatch._auto;
1634
+ console.log({
1635
+ loaded,
1636
+ cached,
1637
+ auto
1638
+ });
1631
1639
 
1632
- function auto() {
1633
- setTimeout(() => {
1634
- if (typeof window.squatch._auto !== "function") return auto();
1635
-
1636
- window.squatch._auto();
1637
- }, 0);
1638
- }
1639
-
1640
- if (loaded && cached) {
1640
+ if (loaded && cached && auto) {
1641
1641
  const ready = cached.ready || [];
1642
1642
  ready.forEach(cb => setTimeout(() => cb(), 0));
1643
- auto(); // @ts-ignore -- intetionally deletes `_squatch` to cleanup initialization
1643
+ setTimeout(() => auto(), 0); // @ts-ignore -- intetionally deletes `_squatch` to cleanup initialization
1644
1644
 
1645
1645
  window._squatch = undefined;
1646
1646