[fix #3606] Add 0x prefix to address when sharing
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
This commit is contained in:
parent
a1d55f30bb
commit
4e413d853e
|
@ -2,6 +2,7 @@
|
||||||
(:require [re-frame.core :refer [reg-sub subscribe]]
|
(:require [re-frame.core :refer [reg-sub subscribe]]
|
||||||
[clojure.string :as string]
|
[clojure.string :as string]
|
||||||
[status-im.ui.screens.accounts.db :as db]
|
[status-im.ui.screens.accounts.db :as db]
|
||||||
|
[status-im.utils.ethereum.core :as ethereum]
|
||||||
[cljs.spec.alpha :as spec]))
|
[cljs.spec.alpha :as spec]))
|
||||||
|
|
||||||
(reg-sub :get-current-public-key
|
(reg-sub :get-current-public-key
|
||||||
|
@ -22,6 +23,11 @@
|
||||||
(fn [[account-id accounts]]
|
(fn [[account-id accounts]]
|
||||||
(some-> accounts (get account-id))))
|
(some-> accounts (get account-id))))
|
||||||
|
|
||||||
|
(reg-sub :get-current-account-hex
|
||||||
|
:<- [:get-current-account-id]
|
||||||
|
(fn [address]
|
||||||
|
(ethereum/normalized-address address)))
|
||||||
|
|
||||||
(reg-sub
|
(reg-sub
|
||||||
:get-account-creation-next-enabled?
|
:get-account-creation-next-enabled?
|
||||||
(fn [{:accounts/keys [create]}]
|
(fn [{:accounts/keys [create]}]
|
||||||
|
|
|
@ -58,14 +58,13 @@
|
||||||
;; Main screen
|
;; Main screen
|
||||||
|
|
||||||
(defn- qr-code [address chain-id]
|
(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}
|
[qr-code-viewer/qr-code-viewer {:hint-style styles/hint :footer-style styles/footer}
|
||||||
(eip681/generate-uri address {:chain-id chain-id})
|
(eip681/generate-uri address {:chain-id chain-id})
|
||||||
(i18n/label :t/request-qr-legend)
|
(i18n/label :t/request-qr-legend)
|
||||||
address]))
|
address])
|
||||||
|
|
||||||
(views/defview request-transaction []
|
(views/defview request-transaction []
|
||||||
(views/letsubs [{:keys [address]} [:get-current-account]
|
(views/letsubs [address-hex [:get-current-account-hex]
|
||||||
chain-id [:get-network-id]]
|
chain-id [:get-network-id]]
|
||||||
[comp/simple-screen
|
[comp/simple-screen
|
||||||
[comp/toolbar {}
|
[comp/toolbar {}
|
||||||
|
@ -74,11 +73,11 @@
|
||||||
[toolbar/actions [{:icon :icons/share
|
[toolbar/actions [{:icon :icons/share
|
||||||
:icon-opts {:color :white
|
:icon-opts {:color :white
|
||||||
:accessibility-label :share-button}
|
:accessibility-label :share-button}
|
||||||
:handler #(list-selection/open-share {:message address})}]]]
|
:handler #(list-selection/open-share {:message address-hex})}]]]
|
||||||
[react/view {:flex 1}
|
[react/view {:flex 1}
|
||||||
[common/network-info {:text-color :white}]
|
[common/network-info {:text-color :white}]
|
||||||
[react/scroll-view styles/request-wrapper
|
[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])
|
[button/primary-button {:on-press #(re-frame/dispatch [:navigate-to :wallet-send-transaction-request])
|
||||||
:style styles/send-request
|
:style styles/send-request
|
||||||
:accessibility-label :sent-transaction-request-button}
|
:accessibility-label :sent-transaction-request-button}
|
||||||
|
|
Loading…
Reference in New Issue