@swype-org/react-sdk 0.1.163 → 0.1.164

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
@@ -6991,6 +6991,7 @@ function usePaymentEffects(deps) {
6991
6991
  pollingRef.current = polling;
6992
6992
  const handleAuthorizedMobileReturnRef = useRef(handleAuthorizedMobileReturn);
6993
6993
  handleAuthorizedMobileReturnRef.current = handleAuthorizedMobileReturn;
6994
+ const lastAccountFetchRef = useRef(0);
6994
6995
  useEffect(() => {
6995
6996
  if (depositAmount != null) {
6996
6997
  dispatch({ type: "SYNC_AMOUNT", amount: depositAmount.toString() });
@@ -7307,11 +7308,18 @@ function usePaymentEffects(deps) {
7307
7308
  clearMobileFlowState();
7308
7309
  dispatch({ type: "TRANSFER_COMPLETED", transfer: polling.transfer });
7309
7310
  onComplete?.(polling.transfer);
7311
+ reloadAccounts();
7310
7312
  } else if (polling.transfer.status === "FAILED") {
7311
7313
  clearMobileFlowState();
7312
7314
  dispatch({ type: "TRANSFER_FAILED", transfer: polling.transfer, error: "Transfer failed." });
7313
7315
  }
7314
- }, [polling.transfer, onComplete, dispatch]);
7316
+ }, [polling.transfer, onComplete, dispatch, reloadAccounts]);
7317
+ useEffect(() => {
7318
+ if (state.step === "deposit" && state.accounts.length > 0 && authenticated && Date.now() - lastAccountFetchRef.current > 15e3) {
7319
+ lastAccountFetchRef.current = Date.now();
7320
+ reloadAccounts();
7321
+ }
7322
+ }, [state.step, state.accounts.length, authenticated, reloadAccounts]);
7315
7323
  useEffect(() => {
7316
7324
  if (state.step !== "processing") {
7317
7325
  processingStartedAtRef.current = null;