@ -30,16 +30,11 @@
'click #request-voice' : 'requestVoice' ,
'click #request-voice' : 'requestVoice' ,
'click #request-sms' : 'requestSMSVerification' ,
'click #request-sms' : 'requestSMSVerification' ,
'change #code' : 'onChangeCode' ,
'change #code' : 'onChangeCode' ,
'click # verifyCode': 'verifyCode ',
'click # register': 'register ',
} ,
} ,
verifyCode ( ) {
register ( ) {
const number = this . phoneView . validateNumber ( ) ;
const verificationCode = $ ( '#code' )
. val ( )
. replace ( /\D+/g , '' ) ;
this . accountManager
this . accountManager
. registerSingleDevice ( number , verificationCode )
. registerSingleDevice ( )
. then ( ( ) => {
. then ( ( ) => {
this . $el . trigger ( 'openInbox' ) ;
this . $el . trigger ( 'openInbox' ) ;
} )
} )
@ -49,17 +44,6 @@
window . log . info ( s ) ;
window . log . info ( s ) ;
this . $ ( '#status' ) . text ( s ) ;
this . $ ( '#status' ) . text ( s ) ;
} ,
} ,
validateCode ( ) {
const verificationCode = $ ( '#code' )
. val ( )
. replace ( /\D/g , '' ) ;
if ( verificationCode . length === 6 ) {
return verificationCode ;
}
return null ;
} ,
displayError ( error ) {
displayError ( error ) {
this . $ ( '#error' )
this . $ ( '#error' )
. hide ( )
. hide ( )