only look for empty phone on submit

thanks @rschamp!
This commit is contained in:
Matthew Taylor 2016-08-10 09:45:21 -04:00
parent 30945bc078
commit 6e3a18a574

View file

@ -416,7 +416,7 @@ module.exports = {
};
},
onValidSubmit: function (formData, reset, invalidate) {
if (formData.phone.national_number.length !== formData.phone.country_code.format.length) {
if (!formData.phone || formData.phone.national_number === '+') {
return invalidate({
'phone': this.props.intl.formatMessage({id: 'teacherRegistration.validationPhoneNumber'})
});