@swype-org/react-sdk 0.1.162 → 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.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1773,8 +1773,8 @@ function buildSelectSourceChoices(options) {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
return chainChoices.map((chain) => ({
|
|
1775
1775
|
...chain,
|
|
1776
|
-
tokens: chain.tokens.filter((t) => t.balance > 0)
|
|
1777
|
-
})).filter((chain) => chain.tokens.length > 0);
|
|
1776
|
+
tokens: chain.tokens.filter((t) => t.balance > 0).sort((a, b) => b.balance - a.balance)
|
|
1777
|
+
})).filter((chain) => chain.tokens.length > 0).sort((a, b) => b.balance - a.balance);
|
|
1778
1778
|
}
|
|
1779
1779
|
|
|
1780
1780
|
// src/paymentReducer.ts
|
|
@@ -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;
|