ソースを参照

Fixes #1490. Don't reconnect if were weren't auth'd to begin with.

JC Brand 5 年 前
コミット
095a1bc56b
2 ファイル変更9 行追加3 行削除
  1. 1 0
      CHANGES.md
  2. 8 3
      src/headless/converse-core.js

+ 1 - 0
CHANGES.md

@@ -3,6 +3,7 @@
 ## 7.0.0 (Unreleased)
 
 - #1313: Stylistic improvements to the send button
+- #1490: Busy-loop when fetching registration form fails
 - #1535: Add option to destroy a MUC
 - #1715: Update chat state notification after receiving a message correction.
 - #1793: Send button doesn't appear in Firefox in 1:1 chats

+ 8 - 3
src/headless/converse-core.js

@@ -1269,10 +1269,15 @@ _converse.api = {
                 // (now failed) session.
                 await _converse.setUserJID(_converse.settings.jid);
             }
-            if (_converse.connection.reconnecting) {
-                debouncedReconnect();
+
+            if (_converse.connection.authenticated) {
+                if (_converse.connection.reconnecting) {
+                    debouncedReconnect();
+                } else {
+                    return reconnect();
+                }
             } else {
-                return reconnect();
+                log.warn("Not attempting to reconnect because we're not authenticated");
             }
         },