diff --git a/src/status_im/contexts/wallet/bridge/input_amount/view.cljs b/src/status_im/contexts/wallet/bridge/input_amount/view.cljs index c68560bd83..44ebea89fc 100644 --- a/src/status_im/contexts/wallet/bridge/input_amount/view.cljs +++ b/src/status_im/contexts/wallet/bridge/input_amount/view.cljs @@ -9,7 +9,7 @@ (defn view [] - (hot-reload/use-safe-unmount #(rf/dispatch [:wallet/stop-get-suggested-routes])) + (hot-reload/use-safe-unmount #(rf/dispatch [:wallet/suggested-routes-cleanup])) [rn/view {:style style/bridge-send-wrapper} [input-amount/view {:current-screen-id :screen/wallet.bridge-input-amount diff --git a/src/status_im/contexts/wallet/send/events.cljs b/src/status_im/contexts/wallet/send/events.cljs index 76ef4d028c..495a6e8c98 100644 --- a/src/status_im/contexts/wallet/send/events.cljs +++ b/src/status_im/contexts/wallet/send/events.cljs @@ -489,13 +489,18 @@ (rf/reg-event-fx :wallet/stop-get-suggested-routes (fn [] - {:fx [[:dispatch [:wallet/clean-routes-calculation]]] - :json-rpc/call [{:method "wallet_stopSuggestedRoutesAsyncCalculation" - :params [] - :on-error (fn [error] - (log/error "failed to stop suggested routes calculation" - {:event :wallet/stop-get-suggested-routes - :error error}))}]})) + {:fx [[:json-rpc/call + [{:method "wallet_stopSuggestedRoutesAsyncCalculation" + :params [] + :on-error (fn [error] + (log/error "failed to stop suggested routes calculation" + {:event :wallet/stop-get-suggested-routes + :error error}))}]]]})) + +(rf/reg-event-fx :wallet/suggested-routes-cleanup + (fn [] + {:fx [[:dispatch [:wallet/clean-routes-calculation]] + [:dispatch [:wallet/stop-get-suggested-routes]]]})) (defn- bridge-amount-greater-than-bonder-fees? [{{token-decimals :decimals} :from-token diff --git a/src/status_im/contexts/wallet/send/input_amount/view.cljs b/src/status_im/contexts/wallet/send/input_amount/view.cljs index 8cb71b157e..0418dbd9d4 100644 --- a/src/status_im/contexts/wallet/send/input_amount/view.cljs +++ b/src/status_im/contexts/wallet/send/input_amount/view.cljs @@ -156,6 +156,7 @@ [just-toggled-mode? set-just-toggled-mode?] (rn/use-state false) handle-on-confirm (fn [amount] + (rf/dispatch [:wallet/stop-get-suggested-routes]) (rf/dispatch [:wallet/set-token-amount-to-send {:amount amount :stack-id current-screen-id}])) diff --git a/src/status_im/contexts/wallet/send/send_amount/view.cljs b/src/status_im/contexts/wallet/send/send_amount/view.cljs index b11e69c9a4..e076f893e8 100644 --- a/src/status_im/contexts/wallet/send/send_amount/view.cljs +++ b/src/status_im/contexts/wallet/send/send_amount/view.cljs @@ -2,11 +2,13 @@ (:require [quo.theme] [status-im.contexts.wallet.send.input-amount.view :as input-amount] + [status-im.setup.hot-reload :as hot-reload] [utils.i18n :as i18n] [utils.re-frame :as rf])) (defn view [] + (hot-reload/use-safe-unmount #(rf/dispatch [:wallet/suggested-routes-cleanup])) [input-amount/view {:current-screen-id :screen/wallet.send-input-amount :button-one-label (i18n/label :t/review-send)