From 398289a946fadc591cc371605873c394e77f0548 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Thu, 21 Nov 2024 20:54:45 +0300 Subject: [PATCH] [#21557] fix: check for root screen --- src/status_im/contexts/wallet/swap/events.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/status_im/contexts/wallet/swap/events.cljs b/src/status_im/contexts/wallet/swap/events.cljs index d671d184d2b..6ce96388893 100644 --- a/src/status_im/contexts/wallet/swap/events.cljs +++ b/src/status_im/contexts/wallet/swap/events.cljs @@ -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) @@ -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)]]