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