gdm: Emit the 'failed' status immediately, and not on reset

There's really no reason to do it this way: it works in both cases,
and it's a lot simpler to reason about.
This commit is contained in:
Jasper St. Pierre 2014-03-07 17:42:53 -05:00
parent 0c511c884b
commit 6e27ef8ff9

View File

@ -257,6 +257,8 @@ const AuthPrompt = new Lang.Class({
this.updateSensitivity(true);
this.setActorInDefaultButtonWell(null);
this.verificationStatus = AuthPromptStatus.VERIFICATION_FAILED;
this.emit('failed');
},
_onVerificationComplete: function() {
@ -428,21 +430,17 @@ const AuthPrompt = new Lang.Class({
},
reset: function() {
let oldStatus = this.verificationStatus;
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
if (oldStatus == AuthPromptStatus.VERIFYING)
if (this.verificationStatus == AuthPromptStatus.VERIFYING)
this._userVerifier.cancel();
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
this._queryingService = null;
this.clear();
this._message.opacity = 0;
this.setUser(null);
this.stopSpinning();
if (oldStatus == AuthPromptStatus.VERIFICATION_FAILED)
this.emit('failed');
let beginRequestType;
if (this._mode == AuthPromptMode.UNLOCK_ONLY) {