Selaa lähdekoodia

Use `findWhere` when looking for only one instance

JC Brand 6 vuotta sitten
vanhempi
commit
63d258a00a
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      src/headless/converse-muc.js

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

@@ -1811,9 +1811,9 @@ converse.plugins.add('converse-muc', {
                  */
                 const jid = Strophe.getBareJidFromJid(data.jid);
                 if (jid !== null) {
-                    return this.where({'jid': jid}).pop();
+                    return this.findWhere({'jid': jid});
                 } else {
-                    return this.where({'nick': data.nick}).pop();
+                    return this.findWhere({'nick': data.nick});
                 }
             }
         });