From 2d1f8989a9a39c6369380391b3ff6571cfabb450 Mon Sep 17 00:00:00 2001 From: psdp <4315882+psdp@users.noreply.github.com> Date: Tue, 8 May 2018 07:07:44 +0000 Subject: [PATCH] [#4043] 'GOT IT' screen is not shown after signing an unsigned transaction Signed-off-by: Andrey Shovkoplyas --- src/status_im/ui/screens/wallet/events.cljs | 5 +++-- src/status_im/ui/screens/wallet/send/events.cljs | 6 ++++-- src/status_im/ui/screens/wallet/transactions/views.cljs | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/status_im/ui/screens/wallet/events.cljs b/src/status_im/ui/screens/wallet/events.cljs index b9a6dd0bd3..3372dd27d9 100644 --- a/src/status_im/ui/screens/wallet/events.cljs +++ b/src/status_im/ui/screens/wallet/events.cljs @@ -227,8 +227,9 @@ (handlers/register-handler-fx :wallet/show-sign-transaction - (fn [{:keys [db]} [_ id from-chat?]] - {:db (assoc-in db [:wallet :send-transaction] {:id id + (fn [{:keys [db]} [_ {:keys [id method]} from-chat?]] + {:db (assoc-in db [:wallet :send-transaction] {:id id + :method method :from-chat? from-chat?}) :dispatch [:navigate-to-modal :wallet-send-transaction-modal]})) diff --git a/src/status_im/ui/screens/wallet/send/events.cljs b/src/status_im/ui/screens/wallet/send/events.cljs index c998d55c29..49a45d67e6 100644 --- a/src/status_im/ui/screens/wallet/send/events.cljs +++ b/src/status_im/ui/screens/wallet/send/events.cljs @@ -104,7 +104,7 @@ (fn [_ _] {::show-transaction-moved true})) -(defn prepare-transaction [{:keys [id message_id args]} now] +(defn prepare-transaction [{:keys [id message_id method args]} now] ;;NOTE(goranjovic): the transactions started from chat using /send command ;; are only in ether, so this parameter defaults to ETH (let [{:keys [from to value symbol data gas gasPrice] :or {symbol :ETH}} args] @@ -114,6 +114,7 @@ :to-name (when (nil? to) (i18n/label :t/new-contract)) :symbol symbol + :method method :value (money/bignumber (or value 0)) :data data :gas (when (seq gas) @@ -255,7 +256,7 @@ (fn [{{:keys [web3] :as db} :db} [_ later?]] (let [db' (assoc-in db [:wallet :send-transaction :wrong-password?] false) network (:network db) - {:keys [amount id password to symbol gas gas-price]} (get-in db [:wallet :send-transaction])] + {:keys [amount id password to symbol method gas gas-price]} (get-in db [:wallet :send-transaction])] (if id {::accept-transaction {:id id :password password @@ -272,6 +273,7 @@ :gas gas :gas-price gas-price :symbol symbol + :method method :network network}})))) (handlers/register-handler-fx diff --git a/src/status_im/ui/screens/wallet/transactions/views.cljs b/src/status_im/ui/screens/wallet/transactions/views.cljs index 88dcd04986..af322e3905 100644 --- a/src/status_im/ui/screens/wallet/transactions/views.cljs +++ b/src/status_im/ui/screens/wallet/transactions/views.cljs @@ -38,10 +38,10 @@ nil)]) ;; TODO (andrey) implement [unsigned-action unsigned-transactions-count] -(defn action-buttons [{:keys [id] :as transaction}] +(defn action-buttons [transaction] [react/view {:style styles/action-buttons} [button/primary-button {:style {:margin-right 12} - :on-press #(re-frame/dispatch [:wallet/show-sign-transaction id]) + :on-press #(re-frame/dispatch [:wallet/show-sign-transaction transaction]) :accessibility-label :sign-button} (i18n/label :t/transactions-sign)] [button/secondary-button {:on-press #(on-delete-transaction transaction)