From 957c09a55eca3770ff65089148e7d00a26d0db74 Mon Sep 17 00:00:00 2001 From: Goran Jovic Date: Fri, 25 May 2018 09:22:11 +0200 Subject: [PATCH] bug 4123 - fixed dapp transactions and incorrect amount formatting in transaction fee screen Signed-off-by: Goran Jovic --- src/status_im/ui/screens/wallet/components/views.cljs | 2 +- src/status_im/ui/screens/wallet/send/views.cljs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/status_im/ui/screens/wallet/components/views.cljs b/src/status_im/ui/screens/wallet/components/views.cljs index 30505925cd..8acf0b1430 100644 --- a/src/status_im/ui/screens/wallet/components/views.cljs +++ b/src/status_im/ui/screens/wallet/components/views.cljs @@ -210,7 +210,7 @@ [react/view [components/cartouche {:disabled? disabled?} (i18n/label :t/amount) - [amount-input m]] + [amount-input m token]] (when error [tooltip/tooltip error])]) diff --git a/src/status_im/ui/screens/wallet/send/views.cljs b/src/status_im/ui/screens/wallet/send/views.cljs index 790fb835c2..edb3daa5b6 100644 --- a/src/status_im/ui/screens/wallet/send/views.cljs +++ b/src/status_im/ui/screens/wallet/send/views.cljs @@ -115,9 +115,11 @@ (defview transaction-fee [] (letsubs [{:keys [amount symbol] :as transaction} [:wallet.send/transaction] + network [:get-current-account-network] edit [:wallet/edit]] (let [gas (or (:gas edit) (:gas transaction)) - gas-price (or (:gas-price edit) (:gas-price transaction))] + gas-price (or (:gas-price edit) (:gas-price transaction)) + {:keys [decimals]} (tokens/asset-for (ethereum/network->chain-keyword network) symbol)] [wallet.components/simple-screen {:status-toolbar-type :modal-wallet} [toolbar true act/close-white (i18n/label :t/wallet-transaction-fee)] @@ -151,7 +153,7 @@ (i18n/label :t/amount) [react/view {:accessibility-label :amount-input} [wallet.components/cartouche-text-content - (str (money/to-fixed (money/wei->ether amount))) + (str (money/to-fixed (money/internal->formatted amount symbol decimals))) (name symbol)]]] [wallet.components/cartouche {:disabled? true} (i18n/label :t/wallet-transaction-total-fee) @@ -280,7 +282,7 @@ (i18n/label :t/message) [components/amount-input {:disabled? true :input-options {:multiline true - :default-value data}}]]]] + :default-value data}} nil]]]] [signing-buttons #(re-frame/dispatch [:wallet/discard-transaction-navigate-back]) #(re-frame/dispatch [:wallet/sign-transaction-modal])