fix crash and adapt loading state

Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
Brian Sztamfater 2024-11-21 14:02:21 -03:00
parent 565445712b
commit ac0f8e4e70
No known key found for this signature in database
GPG Key ID: 59EB921E0706B48F
3 changed files with 8 additions and 10 deletions

View File

@ -62,6 +62,5 @@
{:container-style style/fees-data-item
:status (if loading-routes? :loading :default)
:size :small
:title (i18n/label :t/fees)
:subtitle fees}]
[received-amount {:loading-routes? loading-routes?}]])
:title (i18n/label :t/max-fees)
:subtitle fees}]])

View File

@ -25,10 +25,9 @@
:height 40})
(def fees-data-item
{:flex 1
:height 40
:margin-horizontal 16
:background-color :transparent})
{:flex 1
:height 40
:background-color :transparent})
(def amount-data-item
{:flex 1

View File

@ -108,7 +108,7 @@
{:keys [total-balance]
:as token-by-symbol} (rf/sub [:wallet/token-by-symbol
(str token-symbol)
(:chain-id network)])
[(:chain-id network)]])
currency-symbol (rf/sub [:profile/currency-symbol])
loading-routes? (rf/sub [:wallet/wallet-send-loading-suggested-routes?])
route (rf/sub [:wallet/wallet-send-route])
@ -117,7 +117,7 @@
enough-assets? (rf/sub [:wallet/wallet-send-enough-assets?])
owned-eth-token (rf/sub [:wallet/token-by-symbol
(string/upper-case constants/mainnet-short-name)
(:chain-id network)])
[(:chain-id network)]])
suggested-routes (rf/sub [:wallet/wallet-send-suggested-routes])
[crypto-currency?
set-crypto-currency] (rn/use-state initial-crypto-currency?)
@ -265,7 +265,7 @@
(controlled-input/upper-limit-bn
input-state)))})
:status (when (controlled-input/input-error input-state) :error)}]}]
(when loading-routes? [quo/text "Loading"])
[rn/view {:style {:flex 1}}]
(when not-enough-asset?
[not-enough-asset])
(when (or (and (not no-routes-found?) (or loading-routes? route))