Skip to content

Commit 68366d9

Browse files
[#22010] fix: wrong selected account for bridging (#22511)
1 parent ece95ca commit 68366d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/status_im/contexts/wallet/events.cljs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@
7777

7878
(rf/reg-event-fx :wallet/switch-current-viewing-account
7979
(fn [{:keys [db]} [address]]
80-
{:db (assoc-in db [:wallet :current-viewing-account-address] address)}))
80+
(let [{:keys [tx-type]} (db/send db)
81+
bridge-tx? (= tx-type :tx/bridge)]
82+
{:db (cond-> db
83+
:always (assoc-in [:wallet :current-viewing-account-address] address)
84+
bridge-tx? (update-in db-path/send assoc :to-address address))})))
8185

8286
(rf/reg-event-fx :wallet/clean-current-viewing-account
8387
(fn [{:keys [db]} [ignore-just-completed-transaction?]]

0 commit comments

Comments
 (0)