From aaaa625e9ae23c7b5f5105f2f0d9b5b5fcba6429 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Sat, 4 May 2019 21:24:55 +0300 Subject: [PATCH] [#1442] Allow only decimal number in send command --- src/status_im/chat/commands/impl/transactions.cljs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/status_im/chat/commands/impl/transactions.cljs b/src/status_im/chat/commands/impl/transactions.cljs index 42f723cff7..12327ce079 100644 --- a/src/status_im/chat/commands/impl/transactions.cljs +++ b/src/status_im/chat/commands/impl/transactions.cljs @@ -161,7 +161,9 @@ (or (js/isNaN amount) (> (count portions) 2) - (re-matches #".+(\.|,)$" amount-string)) + (re-matches #".+(\.|,)$" amount-string) + ;; check if non-decimal number + (re-matches #"0[\dbxo][\d\.]*" amount-string)) {:title (i18n/label :t/send-request-amount) :description (i18n/label :t/send-request-amount-invalid-number)}