Skip to content

Commit

Permalink
[#21557] fix: check for root screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Nov 22, 2024
1 parent dbc96ad commit 398289a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/status_im/contexts/wallet/swap/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
(let [{:keys [wallet]} db
test-networks-enabled? (get-in db [:profile/profile :test-networks-enabled?])
view-id (:view-id db)
root-screen? (or (= view-id :wallet-stack) (nil? view-id))
account (or from-account (swap-utils/wallet-account wallet))
asset-to-pay (if (get-in data [:asset-to-pay :networks])
(:asset-to-pay data)
Expand All @@ -39,7 +40,7 @@
(assoc-in [:wallet :ui :swap :network] network')
(assoc-in [:wallet :ui :swap :launch-screen] view-id)
(assoc-in [:wallet :ui :swap :start-point] start-point))
:fx (if (and multi-account-balance? (= view-id :wallet-stack) (not from-account))
:fx (if (and multi-account-balance? root-screen? (not from-account))
[[:dispatch [:open-modal :screen/wallet.swap-select-account]]]
(if network'
[[:dispatch [:wallet/switch-current-viewing-account (:address account)]]
Expand Down

0 comments on commit 398289a

Please sign in to comment.