Sfoglia il codice sorgente

Reject the `waitUntilFeaturesDiscovered` promise if query failed

No code relies on this currently, but it's seems the right thing to do
JC Brand 6 anni fa
parent
commit
01f0a65209
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 1 1
      dist/converse.js
  2. 2 2
      src/headless/converse-disco.js

+ 1 - 1
dist/converse.js

@@ -64702,7 +64702,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-dis
           const stanza = await _converse.api.disco.info(this.get('jid'), null);
           this.onInfo(stanza);
         } catch (iq) {
-          this.waitUntilFeaturesDiscovered.resolve(this);
+          this.waitUntilFeaturesDiscovered.reject(iq);
 
           _converse.log(iq, Strophe.LogLevel.ERROR);
         }

+ 2 - 2
src/headless/converse-disco.js

@@ -130,8 +130,8 @@ converse.plugins.add('converse-disco', {
                 try {
                     const stanza = await _converse.api.disco.info(this.get('jid'), null);
                     this.onInfo(stanza);
-                } catch(iq) {
-                    this.waitUntilFeaturesDiscovered.resolve(this);
+                } catch (iq) {
+                    this.waitUntilFeaturesDiscovered.reject(iq);
                     _converse.log(iq, Strophe.LogLevel.ERROR);
                 }
             },