From 0957fb6e0a823fa84d02d480c94936cb519318a1 Mon Sep 17 00:00:00 2001 From: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:55:19 +0530 Subject: [PATCH] fix(wallet)_: Activity tab is selected on navigating back from the swap flow (#21474) This commit fixes activity tab is selected when navigating back from the swap flow Signed-off-by: Mohamed Javid <19339952+smohamedjavid@users.noreply.github.com> --- src/status_im/contexts/wallet/swap/events.cljs | 7 +------ src/status_im/contexts/wallet/swap/setup_swap/view.cljs | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/status_im/contexts/wallet/swap/events.cljs b/src/status_im/contexts/wallet/swap/events.cljs index 3b512f222e..cbd1f27d1b 100644 --- a/src/status_im/contexts/wallet/swap/events.cljs +++ b/src/status_im/contexts/wallet/swap/events.cljs @@ -204,12 +204,6 @@ (fn [{:keys [db]}] {:db (update-in db [:wallet :ui] dissoc :swap)})) -(rf/reg-event-fx - :wallet/on-swap-done - (fn [_] - {:fx [[:dispatch [:wallet/select-account-tab :activity]] - [:dispatch [:wallet/clean-swap]]]})) - (rf/reg-event-fx :wallet/swap-transaction (fn [{:keys [db]} [sha3-pwd]] (let [wallet-address (get-in db @@ -299,6 +293,7 @@ :screen/wallet.swap-set-spending-cap :screen/wallet.swap-confirmation)]) (when-not approval-required? + (rf/dispatch [:wallet/select-account-tab :activity]) (debounce/debounce-and-dispatch [:toasts/upsert {:id :swap-transaction-pending diff --git a/src/status_im/contexts/wallet/swap/setup_swap/view.cljs b/src/status_im/contexts/wallet/swap/setup_swap/view.cljs index 96c24bee78..787c8edf77 100644 --- a/src/status_im/contexts/wallet/swap/setup_swap/view.cljs +++ b/src/status_im/contexts/wallet/swap/setup_swap/view.cljs @@ -156,7 +156,7 @@ :valid-input? valid-pay-input? :clean-approval-transaction? true})) [pay-input-amount])] - (rn/use-unmount #(rf/dispatch [:wallet/on-swap-done])) + (rn/use-unmount #(rf/dispatch [:wallet/clean-swap])) (rn/use-effect (fn [] (request-fetch-swap-proposal))