@pollar/react 0.12.0-rc.5 → 0.12.0

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
@@ -1044,7 +1044,7 @@ var PollarModalFooter = () => {
1044
1044
  /* @__PURE__ */ jsxRuntime.jsx("img", { src: LOGO_POLLAR_WORDMARK_ON_DARK, alt: "Pollar", className: "pollar-footer-logo pollar-logo-on-dark" }),
1045
1045
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pollar-footer-version", children: [
1046
1046
  "v",
1047
- "0.12.0-rc.5"
1047
+ "0.12.0"
1048
1048
  ] })
1049
1049
  ] });
1050
1050
  };
@@ -4812,6 +4812,7 @@ function RampWidget({ onClose }) {
4812
4812
  const [pollTrouble, setPollTrouble] = react.useState(false);
4813
4813
  const [pollKey, setPollKey] = react.useState(0);
4814
4814
  const [paymentCheckUntil, setPaymentCheckUntil] = react.useState(null);
4815
+ const checkErrorRef = react.useRef(null);
4815
4816
  const promptedApproval = react.useRef(null);
4816
4817
  const custodyChoice = appConfig.application?.walletCustodyMode === "USER_CHOICE";
4817
4818
  const appChains = appConfig.application?.chains;
@@ -4895,6 +4896,12 @@ function RampWidget({ onClose }) {
4895
4896
  }, PAYMENT_CHECK_EVERY_MS);
4896
4897
  return () => clearInterval(timer);
4897
4898
  }, [client, orderId, awaitingPayment, paymentCheckUntil]);
4899
+ react.useEffect(() => {
4900
+ if (awaitingPayment || checkErrorRef.current === null) return;
4901
+ const shown = checkErrorRef.current;
4902
+ checkErrorRef.current = null;
4903
+ setErrorMsg((current) => current === shown ? null : current);
4904
+ }, [awaitingPayment]);
4898
4905
  const approval = order?.pendingAction?.kind === "COSIGN_APPROVAL" ? order.pendingAction.actionId : null;
4899
4906
  react.useEffect(() => {
4900
4907
  if (!approval || promptedApproval.current === approval) return;
@@ -5125,8 +5132,11 @@ function RampWidget({ onClose }) {
5125
5132
  try {
5126
5133
  setOrder(await client.checkRampOrder(order.id));
5127
5134
  } catch (error) {
5135
+ if (core.isPollarNetworkError(error)) return;
5128
5136
  setPaymentCheckUntil(null);
5129
- setErrorMsg(rampErrorMessage(error, "Could not check the payment. Please try again."));
5137
+ const message = rampErrorMessage(error, "Could not check the payment. Please try again.");
5138
+ checkErrorRef.current = message;
5139
+ setErrorMsg(message);
5130
5140
  }
5131
5141
  }
5132
5142
  async function handleRetryOrder() {