From 219ae0ccbea0f08ae90a74ea75cfba34101c1f31 Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Thu, 16 May 2024 18:15:53 +0400 Subject: [PATCH] fix: wallet send navigation flow (#20008) fix: wallet send navigation flow (#20008) --- src/status_im/contexts/wallet/send/flow_config.cljs | 4 +--- src/status_im/contexts/wallet/send/select_asset/view.cljs | 3 +++ src/status_im/contexts/wallet/wallet_connect/utils.cljs | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/status_im/contexts/wallet/send/flow_config.cljs b/src/status_im/contexts/wallet/send/flow_config.cljs index 79e97fb1fc..bcf1c0f746 100644 --- a/src/status_im/contexts/wallet/send/flow_config.cljs +++ b/src/status_im/contexts/wallet/send/flow_config.cljs @@ -19,9 +19,7 @@ {:screen-id :screen/wallet.select-asset :skip-step? (fn [db] (or (token-selected? db) (collectible-selected? db)))} {:screen-id :screen/wallet.send-input-amount - :skip-step? (fn [db] - (or (not (token-selected? db)) - (some? (get-in db [:wallet :ui :send :amount]))))} + :skip-step? (fn [db] (= (get-in db [:wallet :ui :send :tx-type]) :collectible))} {:screen-id :screen/wallet.select-collectible-amount :skip-step? (fn [db] (or (not (collectible-selected? db)) diff --git a/src/status_im/contexts/wallet/send/select_asset/view.cljs b/src/status_im/contexts/wallet/send/select_asset/view.cljs index 0d030f3c52..e146460ea4 100644 --- a/src/status_im/contexts/wallet/send/select_asset/view.cljs +++ b/src/status_im/contexts/wallet/send/select_asset/view.cljs @@ -67,6 +67,9 @@ (rf/dispatch [:wallet/clean-selected-token]) (rf/dispatch [:wallet/clean-selected-collectible]) (rf/dispatch [:navigate-back]))] + (rn/use-unmount (fn [] + (rf/dispatch [:wallet/clean-selected-token]) + (rf/dispatch [:wallet/clean-selected-collectible]))) (fn [] [rn/safe-area-view {:style style/container} [account-switcher/view diff --git a/src/status_im/contexts/wallet/wallet_connect/utils.cljs b/src/status_im/contexts/wallet/wallet_connect/utils.cljs index 8cf5952d67..a3414892dd 100644 --- a/src/status_im/contexts/wallet/wallet_connect/utils.cljs +++ b/src/status_im/contexts/wallet/wallet_connect/utils.cljs @@ -1,10 +1,10 @@ (ns status-im.contexts.wallet.wallet-connect.utils ;; NOTE: Not sorting namespaces since @walletconnect/react-native-compat should be the first #_{:clj-kondo/ignore [:unsorted-required-namespaces]} - (:require ["@walletconnect/react-native-compat"] - ["@walletconnect/core" :refer [Core]] - ["@walletconnect/web3wallet" :refer [Web3Wallet]] + (:require ["@walletconnect/core" :refer [Core]] + ["@walletconnect/react-native-compat"] ["@walletconnect/utils" :refer [buildApprovedNamespaces]] + ["@walletconnect/web3wallet" :refer [Web3Wallet]] [status-im.config :as config] [utils.i18n :as i18n]))