fix(wallet): Remove redirection to send flow when the user scans an address QR code (#20979)
This commit is contained in:
parent
c32f31f8cd
commit
2b6e782e80
|
@ -1,33 +1,47 @@
|
||||||
(ns status-im.contexts.shell.qr-reader.sheets.scanned-wallet-address
|
(ns status-im.contexts.shell.qr-reader.sheets.scanned-wallet-address
|
||||||
(:require
|
(:require
|
||||||
[quo.core :as quo]
|
[quo.core :as quo]
|
||||||
[status-im.contexts.wallet.common.utils :as utils]
|
[react-native.clipboard :as clipboard]
|
||||||
[status-im.contexts.wallet.common.utils.networks :as network-utils]
|
|
||||||
[status-im.feature-flags :as ff]
|
[status-im.feature-flags :as ff]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]))
|
[utils.re-frame :as rf]))
|
||||||
|
|
||||||
|
(defn- copy-address
|
||||||
|
[address]
|
||||||
|
(clipboard/set-string address)
|
||||||
|
(rf/dispatch [:toasts/upsert
|
||||||
|
{:type :positive
|
||||||
|
:text (i18n/label :t/address-copied)}]))
|
||||||
|
|
||||||
|
#_(defn- send-to-address
|
||||||
|
[address]
|
||||||
|
(let [[_ split-address] (network-utils/split-network-full-address address)]
|
||||||
|
(rf/dispatch
|
||||||
|
[:wallet/select-send-address
|
||||||
|
{:address address
|
||||||
|
:recipient {:recipient-type :address
|
||||||
|
:label (utils/get-shortened-address split-address)}
|
||||||
|
:stack-id :wallet-select-address
|
||||||
|
:start-flow? true}])))
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[address]
|
[address]
|
||||||
(let [[_ splitted-address] (network-utils/split-network-full-address address)]
|
[:<>
|
||||||
[:<>
|
[quo/drawer-top {:title address :type :address}]
|
||||||
[quo/drawer-top
|
[quo/action-drawer
|
||||||
{:title address
|
[[{:icon :i/copy
|
||||||
:type :address}]
|
:accessibility-label :send-asset
|
||||||
[quo/action-drawer
|
:label (i18n/label :t/copy-address)
|
||||||
[[{:icon :i/send
|
:on-press #(copy-address address)}
|
||||||
|
;; Originally, the flow went to the send flow, but it has been removed to avoid bugs,
|
||||||
|
;; please check https://github.com/status-im/status-mobile/issues/20972 for more context
|
||||||
|
;; The previous code has been commented out to be reintroduced in the future easily.
|
||||||
|
#_{:icon :i/send
|
||||||
:accessibility-label :send-asset
|
:accessibility-label :send-asset
|
||||||
:label (i18n/label :t/send-to-this-address)
|
:label (i18n/label :t/send-to-this-address)
|
||||||
:on-press (fn []
|
:on-press #(send-to-address address)}
|
||||||
(rf/dispatch [:wallet/select-send-address
|
(when (ff/enabled? :ff/wallet.saved-addresses)
|
||||||
{:address address
|
{:icon :i/save
|
||||||
:recipient {:recipient-type :address
|
:accessibility-label :save-address
|
||||||
:label (utils/get-shortened-address
|
:label (i18n/label :t/save-address)
|
||||||
splitted-address)}
|
:on-press #(js/alert "feature not implemented")})]]]])
|
||||||
:stack-id :wallet-select-address
|
|
||||||
:start-flow? true}]))}
|
|
||||||
(when (ff/enabled? :ff/wallet.saved-addresses)
|
|
||||||
{:icon :i/save
|
|
||||||
:accessibility-label :save-address
|
|
||||||
:label (i18n/label :t/save-address)
|
|
||||||
:on-press #(js/alert "feature not implemented")})]]]]))
|
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
[re-frame.events :as rf-events]
|
[re-frame.events :as rf-events]
|
||||||
[re-frame.registrar :as rf-registrar]
|
[re-frame.registrar :as rf-registrar]
|
||||||
[re-frame.subs :as rf-subs]
|
[re-frame.subs :as rf-subs]
|
||||||
[taoensso.timbre :as log] ;; We must require this namespace to register the custom cljs.test
|
[taoensso.timbre :as log]
|
||||||
;; directive `match-strict?`.
|
|
||||||
test-helpers.matchers))
|
test-helpers.matchers))
|
||||||
|
;; We must require `test-helpers.matchers` this namespace to register the custom cljs.test
|
||||||
|
;; directive `match-strict?`.
|
||||||
|
|
||||||
(defn db
|
(defn db
|
||||||
"A simple wrapper to get the latest value from the app db."
|
"A simple wrapper to get the latest value from the app db."
|
||||||
|
|
Loading…
Reference in New Issue