[gnome-shell/gnome-41] authPrompt: Don't propagate serviceName to setMessage
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-41] authPrompt: Don't propagate serviceName to setMessage
- Date: Thu, 11 Aug 2022 13:03:54 +0000 (UTC)
commit a38219f37a621596f4d2ef2b7621661f099f2466
Author: Alessandro Bono <alessandro bono369 gmail com>
Date: Fri Aug 5 12:56:04 2022 +0200
authPrompt: Don't propagate serviceName to setMessage
There isn't always a serviceName when we set a message. Furthermore we
are passing the serviceName only to decide if we want to wiggle or not.
Pass the wiggle parameters instead. If they are missing, we don't want
to wiggle.
This fixes the following error:
JS ERROR: Exception in callback for signal: login-format-changed: Error: Wrong type number; string
expected
setMessage@resource:///org/gnome/shell/gdm/authPrompt.js:542:13
_showRealmLoginHint@resource:///org/gnome/shell/gdm/loginDialog.js:931:26
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
_updateLoginFormat@resource:///org/gnome/shell/gdm/realmd.js:85:18
_reloadRealm@resource:///org/gnome/shell/gdm/realmd.js:57:14
_onRealmLoaded@resource:///org/gnome/shell/gdm/realmd.js:64:14
_makeProxyWrapper/</<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:245:34
Fallout from 526f0711f1a7b7bd8e4913845b5a559f2c93be5c.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5547
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2404>
(cherry picked from commit 32248e822689b9e3357481672396bab3738e6970)
js/gdm/authPrompt.js | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 4844b9ee0c..3ac0faf65a 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -315,7 +315,20 @@ var AuthPrompt = GObject.registerClass({
}
_onShowMessage(_userVerifier, serviceName, message, type) {
- this.setMessage(serviceName, message, type);
+ let wiggleParameters = { duration: 0 };
+
+ if (type === GdmUtil.MessageType.ERROR &&
+ this._userVerifier.serviceIsFingerprint(serviceName)) {
+ // TODO: Use Await for wiggle to be over before unfreezing the user verifier queue
+ wiggleParameters = {
+ duration: 65,
+ wiggleCount: 3,
+ };
+ this._userVerifier.increaseCurrentMessageTimeout(
+ wiggleParameters.duration * (wiggleParameters.wiggleCount + 2));
+ }
+
+ this.setMessage(message, type, wiggleParameters);
this.emit('prompted');
}
@@ -458,7 +471,7 @@ var AuthPrompt = GObject.registerClass({
});
}
- setMessage(serviceName, message, type) {
+ setMessage(message, type, wiggleParameters = { duration: 0 }) {
if (type == GdmUtil.MessageType.ERROR)
this._message.add_style_class_name('login-dialog-message-warning');
else
@@ -477,17 +490,7 @@ var AuthPrompt = GObject.registerClass({
this._message.opacity = 0;
}
- if (type === GdmUtil.MessageType.ERROR &&
- this._userVerifier.serviceIsFingerprint(serviceName)) {
- // TODO: Use Await for wiggle to be over before unfreezing the user verifier queue
- const wiggleParameters = {
- duration: 65,
- wiggleCount: 3,
- };
- this._userVerifier.increaseCurrentMessageTimeout(
- wiggleParameters.duration * (wiggleParameters.wiggleCount + 2));
- Util.wiggle(this._message, wiggleParameters);
- }
+ Util.wiggle(this._message, wiggleParameters);
}
updateSensitivity(sensitive) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]