add phone validation alert

pull/217/head
Pete Matsyburka 2 years ago
parent e6052ad0d8
commit 2a292c8e80

@ -140,7 +140,11 @@ export default {
}) })
}, },
async submit () { async submit () {
if (!this.isCodeSent) { if (!this.$refs.phone.value.toString().startsWith('+')) {
alert(this.t('use_international_format'))
return Promise.reject(new Error('phone invalid'))
} else if (!this.isCodeSent) {
this.sendVerificationCode() this.sendVerificationCode()
this.$emit('update:model-value', this.$refs.phone.value) this.$emit('update:model-value', this.$refs.phone.value)

Loading…
Cancel
Save