MUC: Wait until occupants are fetched before updating them

This commit is contained in:
JC Brand 2021-01-29 13:51:31 +01:00
parent ea6e370347
commit 7abc81f8a4
1 changed files with 2 additions and 1 deletions

View File

@ -2300,7 +2300,8 @@ const ChatRoomMixin = {
* @method _converse.ChatRoom#onOwnPresence
* @param { XMLElement } pres - The stanza
*/
onOwnPresence (stanza) {
async onOwnPresence (stanza) {
await this.occupants.fetched;
if (stanza.getAttribute('type') !== 'unavailable') {
const old_status = this.session.get('connection_status');
if (old_status !== converse.ROOMSTATUS.ENTERED) {