authPrompt: cancel user verification if verifying when reset
authPrompt.reset() currently only leaves the authPrompt in a sane state if the user isn't verifying. This commit makes sure to cancel verification if a reset happens while verification is in process. https://bugzilla.gnome.org/show_bug.cgi?id=683437
This commit is contained in:
parent
1b03e55cc3
commit
f5b2febf13
@ -233,8 +233,10 @@ const AuthPrompt = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_onReset: function() {
|
_onReset: function() {
|
||||||
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED)
|
if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED) {
|
||||||
|
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
||||||
this.reset();
|
this.reset();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onShowLoginHint: function(verifier, message) {
|
_onShowLoginHint: function(verifier, message) {
|
||||||
@ -413,7 +415,12 @@ const AuthPrompt = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function() {
|
||||||
|
let oldStatus = this.verificationStatus;
|
||||||
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
|
||||||
|
|
||||||
|
if (oldStatus == AuthPromptStatus.VERIFYING)
|
||||||
|
this._userVerifier.cancel();
|
||||||
|
|
||||||
this._queryingService = null;
|
this._queryingService = null;
|
||||||
this.clear();
|
this.clear();
|
||||||
this._message.opacity = 0;
|
this._message.opacity = 0;
|
||||||
@ -460,9 +467,6 @@ const AuthPrompt = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
cancel: function() {
|
cancel: function() {
|
||||||
if (this.verificationStatus == AuthPromptStatus.VERIFYING)
|
|
||||||
this._userVerifier.cancel();
|
|
||||||
|
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user