We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de1462f commit 6be9648Copy full SHA for 6be9648
1 file changed
src/modules/call/call.usecase.ts
@@ -26,6 +26,17 @@ export class CallUseCase {
26
async createCallAndRoom(
27
user: User | UserTokenData['payload'],
28
): Promise<CreateCallResponseDto> {
29
+ const activeRoom = await this.roomService.getOpenRoomByHostId(user.uuid);
30
+
31
+ // TODO: Remove this check and look for a better way to handle this
32
+ if (activeRoom) {
33
+ this.logger.warn(
34
+ { userId: user.uuid, roomId: activeRoom.id },
35
+ `User already has an active room as host, closing previous room`,
36
+ );
37
+ await this.roomService.removeRoom(activeRoom.id);
38
+ }
39
40
await this.validateUserHasNoActiveRoom(user.uuid, user.email);
41
42
const call = await this.callService.createCallToken(user);
0 commit comments