From a6c23b2d1b8a6837b437659fbd928c0b9e694a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdussamed=20ULUTA=C5=9E?= Date: Thu, 22 Dec 2022 23:07:58 +0300 Subject: [PATCH] Stage 254 --- frontend/Room.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/Room.ts b/frontend/Room.ts index fba2356..e78b00d 100644 --- a/frontend/Room.ts +++ b/frontend/Room.ts @@ -28,6 +28,7 @@ export default class Room extends EventTarget public name? : string; public owner? : string; public peers? : Map; + public ifexistsJoin : boolean = false; constructor(wsts:MWSE){ super(); @@ -39,15 +40,16 @@ export default class Room extends EventTarget { this.roomId = options; }else{ - Object.assign({ + let defaultOptions = { joinType: "free", ifexistsJoin: true, accessType: "private", notifyActionInvite: true, notifyActionJoined: true, notifyActionEjected: true - },options); - this.options = options; + }; + Object.assign(defaultOptions,options); + this.options = defaultOptions as IRoomOptions; } } @@ -62,7 +64,7 @@ export default class Room extends EventTarget }); if(result.status == 'fail') { - if(result.message == "ALREADY-EXISTS") + if(result.message == "ALREADY-EXISTS" && this.ifexistsJoin) { return this.join(); }