[fix #3606] Add 0x prefix to address when sharing

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
Dmitry Novotochinov 2018-03-22 18:35:17 +03:00 committed by Julien Eluard
parent a1d55f30bb
commit 4e413d853e
No known key found for this signature in database
GPG Key ID: 6FD7DB5437FCBEF6
2 changed files with 13 additions and 8 deletions

View File

@ -2,6 +2,7 @@
(:require [re-frame.core :refer [reg-sub subscribe]]
[clojure.string :as string]
[status-im.ui.screens.accounts.db :as db]
[status-im.utils.ethereum.core :as ethereum]
[cljs.spec.alpha :as spec]))
(reg-sub :get-current-public-key
@ -22,6 +23,11 @@
(fn [[account-id accounts]]
(some-> accounts (get account-id))))
(reg-sub :get-current-account-hex
:<- [:get-current-account-id]
(fn [address]
(ethereum/normalized-address address)))
(reg-sub
:get-account-creation-next-enabled?
(fn [{:accounts/keys [create]}]

View File

@ -58,14 +58,13 @@
;; Main screen
(defn- qr-code [address chain-id]
(let [address (ethereum/normalized-address address)]
[qr-code-viewer/qr-code-viewer {:hint-style styles/hint :footer-style styles/footer}
(eip681/generate-uri address {:chain-id chain-id})
(i18n/label :t/request-qr-legend)
address]))
[qr-code-viewer/qr-code-viewer {:hint-style styles/hint :footer-style styles/footer}
(eip681/generate-uri address {:chain-id chain-id})
(i18n/label :t/request-qr-legend)
address])
(views/defview request-transaction []
(views/letsubs [{:keys [address]} [:get-current-account]
(views/letsubs [address-hex [:get-current-account-hex]
chain-id [:get-network-id]]
[comp/simple-screen
[comp/toolbar {}
@ -74,11 +73,11 @@
[toolbar/actions [{:icon :icons/share
:icon-opts {:color :white
:accessibility-label :share-button}
:handler #(list-selection/open-share {:message address})}]]]
:handler #(list-selection/open-share {:message address-hex})}]]]
[react/view {:flex 1}
[common/network-info {:text-color :white}]
[react/scroll-view styles/request-wrapper
[qr-code address chain-id]
[qr-code address-hex chain-id]
[button/primary-button {:on-press #(re-frame/dispatch [:navigate-to :wallet-send-transaction-request])
:style styles/send-request
:accessibility-label :sent-transaction-request-button}