@rebilly/instruments 8.40.0 → 8.40.1

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
@@ -1,3 +1,10 @@
1
+ ## [8.40.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.40.0...instruments/core-v8.40.1) (2024-02-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **instruments:** account data race condition in fetch data ([#3265](https://github.com/Rebilly/rebilly/issues/3265)) ([3ddc8c2](https://github.com/Rebilly/rebilly/commit/3ddc8c22ff451e664dd3de72c707efed6b81c422))
7
+
1
8
  ## [8.40.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.39.0...instruments/core-v8.40.0) (2024-02-01)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -14605,19 +14605,26 @@ async function fetchData({
14605
14605
  }
14606
14606
  let readyToPayPromise = Promise.resolve(null);
14607
14607
  let readyToPayoutPromise = Promise.resolve(null);
14608
+ let fetchAccountAndWebsitePromise = Promise.resolve();
14608
14609
  let availableInstrumentsPromise = null;
14609
14610
  if ((_d = state.options) == null ? void 0 : _d.jwt) {
14610
- fetchAccountAndWebsite$1().then(({ account, website }) => {
14611
- if (state.data == null) {
14612
- throw new Error("Invalid data instance");
14611
+ fetchAccountAndWebsitePromise = fetchAccountAndWebsite$1().then(
14612
+ ({ account, website }) => {
14613
+ if (state.data == null) {
14614
+ throw new Error("Invalid data instance");
14615
+ }
14616
+ state.data.account = account;
14617
+ state.data.website = website;
14613
14618
  }
14614
- state.data.account = account;
14615
- state.data.website = website;
14616
- });
14619
+ );
14617
14620
  if ((_e = state.options) == null ? void 0 : _e.payout) {
14618
- readyToPayoutPromise = fetchReadyToPayout();
14621
+ readyToPayoutPromise = fetchAccountAndWebsitePromise.then(
14622
+ () => fetchReadyToPayout()
14623
+ );
14619
14624
  } else {
14620
- readyToPayPromise = fetchReadyToPay();
14625
+ readyToPayPromise = fetchAccountAndWebsitePromise.then(
14626
+ () => fetchReadyToPay()
14627
+ );
14621
14628
  }
14622
14629
  availableInstrumentsPromise = fetchInstruments();
14623
14630
  } else {
@@ -23393,7 +23400,7 @@ function handleComputedProperty(options) {
23393
23400
  var _a;
23394
23401
  return Object.assign({}, options, {
23395
23402
  _computed: {
23396
- version: "8.39.0",
23403
+ version: "8.40.0",
23397
23404
  paymentMethodsUrl: ((_a = options._dev) == null ? void 0 : _a.paymentMethodsUrl) ?? "https://forms.secure-payments.app"
23398
23405
  }
23399
23406
  });
@@ -26725,7 +26732,7 @@ class RebillyInstrumentsInstance {
26725
26732
  await show({ componentName, payload });
26726
26733
  }
26727
26734
  get version() {
26728
- return `RebillyInstruments Ver.${"8.39.0"}`;
26735
+ return `RebillyInstruments Ver.${"8.40.0"}`;
26729
26736
  }
26730
26737
  on(eventName, callback) {
26731
26738
  on({ eventName, callback });