From 874ececc470cb471b00ab30c0821ab66b40ebcc2 Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Tue, 8 Oct 2024 18:16:38 -0300 Subject: [PATCH] fix(swap): update max value when the account is switched (#21395) Signed-off-by: Brian Sztamfater --- src/status_im/contexts/wallet/swap/setup_swap/view.cljs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/status_im/contexts/wallet/swap/setup_swap/view.cljs b/src/status_im/contexts/wallet/swap/setup_swap/view.cljs index 489f6bbd05..9951f36139 100644 --- a/src/status_im/contexts/wallet/swap/setup_swap/view.cljs +++ b/src/status_im/contexts/wallet/swap/setup_swap/view.cljs @@ -85,7 +85,7 @@ [{:keys [input-state on-max-press on-input-focus on-token-press on-approve-press input-focused?]}] (let [account-color (rf/sub [:wallet/current-viewing-account-color]) network (rf/sub [:wallet/swap-network]) - asset-to-pay (rf/sub [:wallet/swap-asset-to-pay]) + pay-token-symbol (:symbol (rf/sub [:wallet/swap-asset-to-pay])) currency (rf/sub [:profile/currency]) loading-swap-proposal? (rf/sub [:wallet/swap-loading-swap-proposal?]) swap-proposal (rf/sub [:wallet/swap-proposal-without-fees]) @@ -96,9 +96,9 @@ approval-transaction-id (rf/sub [:wallet/swap-approval-transaction-id]) approved-amount (rf/sub [:wallet/swap-approved-amount]) error-response (rf/sub [:wallet/swap-error-response]) + asset-to-pay (rf/sub [:wallet/token-by-symbol pay-token-symbol]) pay-input-num-value (controlled-input/value-numeric input-state) pay-input-amount (controlled-input/input-value input-state) - pay-token-symbol (:symbol asset-to-pay) pay-token-decimals (:decimals asset-to-pay) pay-token-balance-selected-chain (get-in asset-to-pay [:balances-per-chain