Fix checkEmail to prevent duplicate checks

This commit is contained in:
Scott Erickson 2016-07-07 16:55:57 -07:00
parent 54c1361b1c
commit 151bf93177

View file

@ -56,7 +56,7 @@ module.exports = class BasicInfoView extends CocoView
checkEmail: -> checkEmail: ->
email = @$('[name="email"]').val() email = @$('[name="email"]').val()
if email is @state.get('lastEmailValue') if email is @state.get('checkEmailValue')
return @state.get('checkEmailPromise') return @state.get('checkEmailPromise')
if not (email and forms.validateEmail(email)) if not (email and forms.validateEmail(email))
@ -65,7 +65,7 @@ module.exports = class BasicInfoView extends CocoView
checkEmailValue: email checkEmailValue: email
checkEmailPromise: null checkEmailPromise: null
}) })
return return Promise.resolve()
@state.set({ @state.set({
checkEmailState: 'checking' checkEmailState: 'checking'