@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.cjs
CHANGED
|
@@ -1776,8 +1776,8 @@ function buildSelectSourceChoices(options) {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
return chainChoices.map((chain) => ({
|
|
1778
1778
|
...chain,
|
|
1779
|
-
tokens: chain.tokens.filter((t) => t.balance > 0)
|
|
1780
|
-
})).filter((chain) => chain.tokens.length > 0);
|
|
1779
|
+
tokens: chain.tokens.filter((t) => t.balance > 0).sort((a, b) => b.balance - a.balance)
|
|
1780
|
+
})).filter((chain) => chain.tokens.length > 0).sort((a, b) => b.balance - a.balance);
|
|
1781
1781
|
}
|
|
1782
1782
|
|
|
1783
1783
|
// src/paymentReducer.ts
|
|
@@ -6994,6 +6994,7 @@ function usePaymentEffects(deps) {
|
|
|
6994
6994
|
pollingRef.current = polling;
|
|
6995
6995
|
const handleAuthorizedMobileReturnRef = react.useRef(handleAuthorizedMobileReturn);
|
|
6996
6996
|
handleAuthorizedMobileReturnRef.current = handleAuthorizedMobileReturn;
|
|
6997
|
+
const lastAccountFetchRef = react.useRef(0);
|
|
6997
6998
|
react.useEffect(() => {
|
|
6998
6999
|
if (depositAmount != null) {
|
|
6999
7000
|
dispatch({ type: "SYNC_AMOUNT", amount: depositAmount.toString() });
|
|
@@ -7310,11 +7311,18 @@ function usePaymentEffects(deps) {
|
|
|
7310
7311
|
clearMobileFlowState();
|
|
7311
7312
|
dispatch({ type: "TRANSFER_COMPLETED", transfer: polling.transfer });
|
|
7312
7313
|
onComplete?.(polling.transfer);
|
|
7314
|
+
reloadAccounts();
|
|
7313
7315
|
} else if (polling.transfer.status === "FAILED") {
|
|
7314
7316
|
clearMobileFlowState();
|
|
7315
7317
|
dispatch({ type: "TRANSFER_FAILED", transfer: polling.transfer, error: "Transfer failed." });
|
|
7316
7318
|
}
|
|
7317
|
-
}, [polling.transfer, onComplete, dispatch]);
|
|
7319
|
+
}, [polling.transfer, onComplete, dispatch, reloadAccounts]);
|
|
7320
|
+
react.useEffect(() => {
|
|
7321
|
+
if (state.step === "deposit" && state.accounts.length > 0 && authenticated && Date.now() - lastAccountFetchRef.current > 15e3) {
|
|
7322
|
+
lastAccountFetchRef.current = Date.now();
|
|
7323
|
+
reloadAccounts();
|
|
7324
|
+
}
|
|
7325
|
+
}, [state.step, state.accounts.length, authenticated, reloadAccounts]);
|
|
7318
7326
|
react.useEffect(() => {
|
|
7319
7327
|
if (state.step !== "processing") {
|
|
7320
7328
|
processingStartedAtRef.current = null;
|