[gnome-shell/benzea/fix-password-login-after-bg-failure: 3/5] gdm: Flip canRetry boolean to doneTrying on verification failure




commit 36ccf63b7a219b7e0eb11158f39c8823a25eb058
Author: Ray Strode <rstrode redhat com>
Date:   Wed Apr 28 10:42:14 2021 -0400

    gdm: Flip canRetry boolean to doneTrying on verification failure
    
    This commit just flips a boolean in the verification failed handler
    to make things easier to read.

 js/gdm/util.js | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 1ee84acde2..bb120a81c2 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -685,29 +685,19 @@ var ShellUserVerifier = class {
             (this._reauthOnly || this._failCounter < this.allowedFailures);
     }
 
-    _verificationFailed(serviceName, retry) {
+    _verificationFailed(serviceName, shouldRetry) {
         // For Not Listed / enterprise logins, immediately reset
         // the dialog
         // Otherwise, when in login mode we allow ALLOWED_FAILURES attempts.
         // After that, we go back to the welcome screen.
 
-        const canRetry = retry && this._canRetry();
-
         this._disconnectSignals();
+
         this._filterServiceMessages(serviceName, MessageType.ERROR);
 
-        if (canRetry) {
-            if (!this.hasPendingMessages) {
-                this._retry(serviceName);
-            } else {
-                const cancellable = this._cancellable;
-                let signalId = this.connect('no-more-messages', () => {
-                    this.disconnect(signalId);
-                    if (!cancellable.is_cancelled())
-                        this._retry(serviceName);
-                });
-            }
-        } else {
+        const doneTrying = !shouldRetry || !this._canRetry();
+
+        if (doneTrying) {
             // eslint-disable-next-line no-lonely-if
             if (!this.hasPendingMessages) {
                 this._cancelAndReset();
@@ -721,7 +711,18 @@ var ShellUserVerifier = class {
             }
         }
 
-        this.emit('verification-failed', serviceName, canRetry);
+        this.emit('verification-failed', serviceName, !doneTrying);
+
+        if (!this.hasPendingMessages) {
+            this._retry(serviceName);
+        } else {
+            const cancellable = this._cancellable;
+            let signalId = this.connect('no-more-messages', () => {
+                this.disconnect(signalId);
+                if (!cancellable.is_cancelled())
+                    this._retry(serviceName);
+            });
+        }
     }
 
     _onServiceUnavailable(_client, serviceName, errorMessage) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]