review notes

This commit is contained in:
Volodymyr Kozieiev 2024-06-13 16:10:12 +01:00
parent fcbffa889d
commit 74926ae92e
No known key found for this signature in database
GPG Key ID: 82B04968DF4C0535
4 changed files with 4 additions and 12 deletions

View File

@ -36,8 +36,8 @@
receiver-network-values (get-in db [:wallet :ui :send :receiver-network-values])
sender-network-values (get-in db [:wallet :ui :send :sender-network-values])
tx-type (get-in db [:wallet :ui :send :tx-type])
disabled-from-chain-ids (or (get-in db [:wallet :ui :send :disabled-from-chain-ids]) [])
from-locked-amounts (or (get-in db [:wallet :ui :send :from-locked-amounts]) {})
disabled-from-chain-ids (get-in db [:wallet :ui :send :disabled-from-chain-ids] [])
from-locked-amounts (get-in db [:wallet :ui :send :from-locked-amounts] {})
token-decimals (if collectible 0 (:decimals token))
native-token? (and token (= token-display-name "ETH"))
routes-available? (pos? (count chosen-route))
@ -321,10 +321,7 @@
(rf/reg-event-fx :wallet/unlock-from-amount
(fn [{:keys [db]} [chain-id]]
(let [new-locked-amounts (-> db
(get-in [:wallet :ui :send :from-locked-amounts])
(dissoc chain-id))]
{:db (assoc-in db [:wallet :ui :send :from-locked-amounts] new-locked-amounts)})))
{:db (update-in db [:wallet :ui :send :from-locked-amounts] dissoc chain-id)}))
(rf/reg-event-fx :wallet/reset-network-amounts-to-zero
(fn [{:keys [db]}]

View File

@ -317,7 +317,6 @@
12))]
(number/remove-trailing-zeroes
new-value))))))]
(rn/use-mount
(fn []
(let [dismiss-keyboard-fn #(when (= % "active") (rn/dismiss-keyboard!))

View File

@ -157,10 +157,7 @@
(map
(fn [[chain-id amount]]
{:chain-id chain-id
:total-amount (let [locked-amount (get from-locked-amounts chain-id)]
(if locked-amount
locked-amount
amount))
:total-amount (get from-locked-amounts chain-id amount)
:type (cond
(contains? from-locked-amounts chain-id) :locked
(contains? not-available-networks-set chain-id) :not-available

View File

@ -83,7 +83,6 @@
(fn [networks [_ chain-id]]
(some #(when (= chain-id (:chain-id %)) %) networks)))
(re-frame/reg-sub
:wallet/selected-network-details
:<- [:wallet/network-details]