diff --git a/src/status_im/chat/handlers/input.cljs b/src/status_im/chat/handlers/input.cljs index 3c58c482e4..c874886a64 100644 --- a/src/status_im/chat/handlers/input.cljs +++ b/src/status_im/chat/handlers/input.cljs @@ -186,7 +186,7 @@ (handlers/register-handler ::proceed-validation-messages (handlers/side-effect! - (fn [db [_ command chat-id {:keys [markup validationHandler parameters] :as errors} proceed-fn]] + (fn [db [_ command chat-id {:keys [markup validationHandler parameters]} proceed-fn]] (let [set-errors #(do (dispatch [:set-chat-ui-props {:validation-messages % :sending-in-progress? false}]))] (cond @@ -321,9 +321,8 @@ {:command command :chat-id chat-id :data-type :validator - :after #(do - (dispatch [::proceed-validation-messages - command chat-id %2 after-validation]))}]))))) + :after #(dispatch [::proceed-validation-messages + command chat-id %2 after-validation])}]))))) (handlers/register-handler :set-chat-seq-arg-input-text diff --git a/src/status_im/utils/phone_number.cljs b/src/status_im/utils/phone_number.cljs index d97cef559a..488cd784f4 100644 --- a/src/status_im/utils/phone_number.cljs +++ b/src/status_im/utils/phone_number.cljs @@ -23,6 +23,8 @@ (defn valid-mobile-number? [number] (when (string? number) - (let [number-obj (awesome-phonenumber. number country-code)] - (and (.isValid number-obj) - (.isMobile number-obj))))) + (let [{:keys [valid type]} (-> (awesome-phonenumber. number country-code) + (.toJSON) + (js->clj :keywordize-keys true))] + (and valid + (some #{(keyword type)} '(:mobile :fixed-line-or-mobile :pager))))))