@mindbill/react 0.44.0 → 0.44.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/dist/index.js CHANGED
@@ -6655,9 +6655,10 @@ function createBillingOperationsClient({
6655
6655
  if (typeof fetcher !== "function") throw new Error("A Fetch API implementation is required.");
6656
6656
  let session = null;
6657
6657
  let pendingSession = null;
6658
+ let pendingSessionSignal = null;
6658
6659
  const mintSession = async (signal, force = false) => {
6659
6660
  if (!force && isFresh(session)) return session;
6660
- if (!force && pendingSession) return pendingSession;
6661
+ if (!force && pendingSession && !pendingSessionSignal?.aborted) return pendingSession;
6661
6662
  const pending = getSession ? getSession({ signal }) : fetcher(sessionEndpoint, {
6662
6663
  method: "POST",
6663
6664
  credentials: "same-origin",
@@ -6672,9 +6673,13 @@ function createBillingOperationsClient({
6672
6673
  session = next;
6673
6674
  return next;
6674
6675
  }).finally(() => {
6675
- if (pendingSession === request) pendingSession = null;
6676
+ if (pendingSession === request) {
6677
+ pendingSession = null;
6678
+ pendingSessionSignal = null;
6679
+ }
6676
6680
  });
6677
6681
  pendingSession = request;
6682
+ pendingSessionSignal = signal;
6678
6683
  return request;
6679
6684
  };
6680
6685
  const get = async (path, signal) => {
@@ -6703,6 +6708,7 @@ function createBillingOperationsClient({
6703
6708
  clearSession() {
6704
6709
  session = null;
6705
6710
  pendingSession = null;
6711
+ pendingSessionSignal = null;
6706
6712
  },
6707
6713
  getBills(query = {}, signal) {
6708
6714
  return get(`/partner/v2/browser/bills${queryString(query)}`, signal);