From 372bf83da556ebbcc86c52872209bbafe78c5ae6 Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Tue, 28 Nov 2023 20:39:32 -0300 Subject: [PATCH] some polishing --- src/status_im2/contexts/wallet/events.cljs | 12 ++++++------ .../contexts/wallet/send/select_address/view.cljs | 2 +- .../wallet/send/transaction_confirmation/view.cljs | 7 +++---- src/status_im2/subs/root.cljs | 1 - src/status_im2/subs/wallet/wallet.cljs | 4 ++-- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/status_im2/contexts/wallet/events.cljs b/src/status_im2/contexts/wallet/events.cljs index 595d3198d8..0d5d124c50 100644 --- a/src/status_im2/contexts/wallet/events.cljs +++ b/src/status_im2/contexts/wallet/events.cljs @@ -126,7 +126,7 @@ (rf/defn clean-scanned-address {:events [:wallet/clean-scanned-address]} [{:keys [db]}] - {:db (dissoc db :wallet/scanned-address :wallet/send-address)}) + {:db (update-in db [:wallet :ui :send] dissoc :to-address)}) (rf/reg-event-fx :wallet/create-derived-addresses (fn [{:keys [db]} [password {:keys [path]} on-success]] @@ -354,6 +354,7 @@ (rf/reg-event-fx :wallet/select-send-address (fn [{:keys [db]} [address]] + (println address "dsadass") {:db (assoc-in db [:wallet :ui :send :to-address] address)})) (rf/reg-event-fx :wallet/get-address-details-success @@ -388,8 +389,8 @@ (rf/reg-event-fx :wallet/get-suggested-routes (fn [{:keys [db]}] (let [wallet-address (get-in db [:wallet :current-viewing-account-address]) - tokens (get-in db [:wallet :accounts]) - account (get-in db [:wallet :accounts wallet-address]) + ;tokens (get-in db [:wallet :accounts]) + ;account (get-in db [:wallet :accounts wallet-address]) token (get-in db [:wallet :ui :send :token]) to-address (get-in db [:wallet :ui :send :to-address]) token-decimal 18 @@ -410,7 +411,7 @@ network-preferences gas-rates {}]] - (println token "fdsfsdfsfdfs") + (prn "=====" request-params) {:json-rpc/call [{:method "wallet_getSuggestedRoutes" :params request-params :on-success (fn [suggested-routes] @@ -429,7 +430,7 @@ to-address (get-in db [:wallet :ui :send :to-address]) best (first (:Best suggested-routes)) from (:From best) - to (:To best) + ;to (:To best) token (get-in db [:wallet :ui :send :token]) token-id (:symbol token) from-asset token-id @@ -462,7 +463,6 @@ :Data "0x"}}] sha3-pwd (native-module/sha3 (str (security/safe-unmask-data password))) request-params [multi-transaction-command transaction-bridge sha3-pwd]] - (prn from "++++BESTSTT") (prn "=====" request-params) {:json-rpc/call [{:method "wallet_createMultiTransaction" :params request-params diff --git a/src/status_im2/contexts/wallet/send/select_address/view.cljs b/src/status_im2/contexts/wallet/send/select_address/view.cljs index 20d365c06b..2c8d394047 100644 --- a/src/status_im2/contexts/wallet/send/select_address/view.cljs +++ b/src/status_im2/contexts/wallet/send/select_address/view.cljs @@ -48,7 +48,7 @@ [input-value input-focused?] (fn [] (let [scanned-address (rf/sub [:wallet/scanned-address]) - send-address (rf/sub [:wallet/send-address]) + send-address (get-in (rf/sub [:wallet]) [:ui :send :to-address]) valid-ens-or-address? (rf/sub [:wallet/valid-ens-or-address?])] [quo/address-input {:on-focus (fn [] diff --git a/src/status_im2/contexts/wallet/send/transaction_confirmation/view.cljs b/src/status_im2/contexts/wallet/send/transaction_confirmation/view.cljs index e5b4a14ad2..ff687e1cf1 100644 --- a/src/status_im2/contexts/wallet/send/transaction_confirmation/view.cljs +++ b/src/status_im2/contexts/wallet/send/transaction_confirmation/view.cljs @@ -7,10 +7,10 @@ [react-native.safe-area :as safe-area] [reagent.core :as reagent] [status-im2.common.resources :as resources] + [status-im2.common.standard-authentication.core :as standard-auth] [status-im2.contexts.wallet.send.transaction-confirmation.style :as style] [utils.i18n :as i18n] - [utils.re-frame :as rf] - [status-im2.common.standard-authentication.core :as standard-auth])) + [utils.re-frame :as rf])) (defn- transaction-title [] @@ -145,8 +145,7 @@ (defn- f-view-internal [_] - (let [reset-slider? (reagent/atom false) - margin-top (safe-area/get-top) + (let [margin-top (safe-area/get-top) biometric-auth? false on-close #(rf/dispatch [:navigate-back-within-stack :wallet-select-asset]) status-account-props {:customization-color :purple diff --git a/src/status_im2/subs/root.cljs b/src/status_im2/subs/root.cljs index c8b1eb1658..8487be197c 100644 --- a/src/status_im2/subs/root.cljs +++ b/src/status_im2/subs/root.cljs @@ -156,7 +156,6 @@ (reg-root-key-sub :wallet/scanned-address :wallet/scanned-address) (reg-root-key-sub :wallet/local-suggestions :wallet/local-suggestions) (reg-root-key-sub :wallet/valid-ens-or-address? :wallet/valid-ens-or-address?) -(reg-root-key-sub :wallet/send-address :wallet/send-address) ;;debug (when js/goog.DEBUG diff --git a/src/status_im2/subs/wallet/wallet.cljs b/src/status_im2/subs/wallet/wallet.cljs index 388135599f..9c19626b60 100644 --- a/src/status_im2/subs/wallet/wallet.cljs +++ b/src/status_im2/subs/wallet/wallet.cljs @@ -47,8 +47,8 @@ :<- [:wallet/accounts] :<- [:wallet/balances] :<- [:wallet/tokens-loading?] - (fn [[accounts balances tokens-loading?]] - (mapv (fn [{:keys [color address type] :as account}] + (fn [[accounts balances _]] + (mapv (fn [{:keys [color address] :as account}] (assoc account :customization-color color :type (if (= type :watch) :watch-only :empty)