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>
This commit is contained in:
Mohamed Javid 2024-10-22 18:55:19 +05:30 committed by GitHub
parent 5118a5095d
commit 0957fb6e0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 7 deletions

View File

@ -204,12 +204,6 @@
(fn [{:keys [db]}] (fn [{:keys [db]}]
{:db (update-in db [:wallet :ui] dissoc :swap)})) {: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 (rf/reg-event-fx :wallet/swap-transaction
(fn [{:keys [db]} [sha3-pwd]] (fn [{:keys [db]} [sha3-pwd]]
(let [wallet-address (get-in db (let [wallet-address (get-in db
@ -299,6 +293,7 @@
:screen/wallet.swap-set-spending-cap :screen/wallet.swap-set-spending-cap
:screen/wallet.swap-confirmation)]) :screen/wallet.swap-confirmation)])
(when-not approval-required? (when-not approval-required?
(rf/dispatch [:wallet/select-account-tab :activity])
(debounce/debounce-and-dispatch (debounce/debounce-and-dispatch
[:toasts/upsert [:toasts/upsert
{:id :swap-transaction-pending {:id :swap-transaction-pending

View File

@ -156,7 +156,7 @@
:valid-input? valid-pay-input? :valid-input? valid-pay-input?
:clean-approval-transaction? true})) :clean-approval-transaction? true}))
[pay-input-amount])] [pay-input-amount])]
(rn/use-unmount #(rf/dispatch [:wallet/on-swap-done])) (rn/use-unmount #(rf/dispatch [:wallet/clean-swap]))
(rn/use-effect (rn/use-effect
(fn [] (fn []
(request-fetch-swap-proposal)) (request-fetch-swap-proposal))