File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,11 @@ export default class Lobby {
309
309
this . lobbyRoom . addEventListener (
310
310
XMPPEvents . MUC_DESTROYED ,
311
311
( reason , jid ) => {
312
+ this . lobbyRoom ?. clean ( ) ;
313
+
314
+ this . lobbyRoom = undefined ;
315
+ logger . info ( 'Lobby room left(destroyed)!' ) ;
316
+
312
317
// we are receiving the jid of the main room
313
318
// means we are invited to join, maybe lobby was disabled
314
319
if ( jid ) {
@@ -317,8 +322,6 @@ export default class Lobby {
317
322
return ;
318
323
}
319
324
320
- this . lobbyRoom . clean ( ) ;
321
-
322
325
this . mainRoom . eventEmitter . emit ( XMPPEvents . MUC_DESTROYED , reason ) ;
323
326
} ) ;
324
327
@@ -327,7 +330,9 @@ export default class Lobby {
327
330
this . mainRoom . addEventListener (
328
331
XMPPEvents . MUC_JOINED ,
329
332
( ) => {
330
- this . leave ( ) ;
333
+ this . leave ( ) . catch ( ( ) => {
334
+ // this may happen if the room has been destroyed.
335
+ } ) ;
331
336
} ) ;
332
337
}
333
338
You can’t perform that action at this time.
0 commit comments