mirror of
https://github.com/status-im/status-react.git
synced 2025-01-16 05:56:15 +00:00
[BUG #1991] Make sure provided eth address is valid
This commit is contained in:
parent
54d68081b4
commit
e99cae58cc
@ -401,6 +401,7 @@
|
|||||||
:wallet-choose-recipient "Choose Recipient"
|
:wallet-choose-recipient "Choose Recipient"
|
||||||
:wallet-choose-from-contacts "Choose From Contacts"
|
:wallet-choose-from-contacts "Choose From Contacts"
|
||||||
:wallet-address-from-clipboard "Use Address From Clipboard"
|
:wallet-address-from-clipboard "Use Address From Clipboard"
|
||||||
|
:wallet-invalid-address "Address is invalid"
|
||||||
:wallet-browse-photos "Browse Photos"
|
:wallet-browse-photos "Browse Photos"
|
||||||
:validation-amount-invalid "Amount is not valid"
|
:validation-amount-invalid "Amount is not valid"
|
||||||
:validation-amount-invalid-number "Amount is not a valid number"
|
:validation-amount-invalid-number "Amount is not a valid number"
|
||||||
|
@ -177,6 +177,11 @@
|
|||||||
(fn []
|
(fn []
|
||||||
(notifications/get-fcm-token)))
|
(notifications/get-fcm-token)))
|
||||||
|
|
||||||
|
(reg-fx
|
||||||
|
:show-error
|
||||||
|
(fn [content]
|
||||||
|
(utils/show-popup "Error" content)))
|
||||||
|
|
||||||
(re-frame/reg-fx
|
(re-frame/reg-fx
|
||||||
:show-confirmation
|
:show-confirmation
|
||||||
(fn [{:keys [title content confirm-button-text on-accept on-cancel]}]
|
(fn [{:keys [title content confirm-button-text on-accept on-cancel]}]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
(ns status-im.ui.screens.wallet.choose-recipient.events
|
(ns status-im.ui.screens.wallet.choose-recipient.events
|
||||||
(:require [status-im.utils.handlers :as handlers]))
|
(:require [status-im.i18n :as i18n]
|
||||||
|
[status-im.utils.handlers :as handlers]))
|
||||||
|
|
||||||
(handlers/register-handler-db
|
(handlers/register-handler-db
|
||||||
:wallet/toggle-flashlight
|
:wallet/toggle-flashlight
|
||||||
@ -13,10 +14,13 @@
|
|||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:choose-recipient
|
:choose-recipient
|
||||||
(fn [{:keys [db]} [_ address name]]
|
(fn [{{:keys [web3] :as db} :db} [_ address name]]
|
||||||
(let [{:keys [view-id]} db]
|
(let [{:keys [view-id]} db
|
||||||
(cond-> {:db (choose-address-and-name db address name)}
|
valid-address? (.isAddress web3 address)]
|
||||||
(= :choose-recipient view-id) (assoc :dispatch [:navigate-back])))))
|
(cond-> {:db db}
|
||||||
|
(= :choose-recipient view-id) (assoc :dispatch [:navigate-back])
|
||||||
|
valid-address? (update :db #(choose-address-and-name % address name))
|
||||||
|
(not valid-address?) (assoc :show-error (i18n/label :t/wallet-invalid-address))))))
|
||||||
|
|
||||||
(handlers/register-handler-fx
|
(handlers/register-handler-fx
|
||||||
:wallet-open-send-transaction
|
:wallet-open-send-transaction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user