Use findWhere when looking for only one instance

This commit is contained in:
JC Brand 2019-07-01 09:55:54 +02:00
parent bb94891621
commit 63d258a00a

View File

@ -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});
}
}
});