From 65c65dbb30a1d4c484a2afc14bb811ac50f23eac Mon Sep 17 00:00:00 2001 From: Robert Long Date: Wed, 4 Aug 2021 17:04:24 -0700 Subject: [PATCH] Set room more reliably --- src/ConferenceCallManagerHooks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ConferenceCallManagerHooks.js b/src/ConferenceCallManagerHooks.js index 2ac9dd2..1584493 100644 --- a/src/ConferenceCallManagerHooks.js +++ b/src/ConferenceCallManagerHooks.js @@ -144,8 +144,6 @@ export function useVideoRoom(manager, roomId, timeout = 5000) { error: undefined, })); - manager.setRoom(roomId); - manager.client.joinRoom(roomId).catch((err) => { setState((prevState) => ({ ...prevState, loading: false, error: err })); }); @@ -153,6 +151,7 @@ export function useVideoRoom(manager, roomId, timeout = 5000) { let initialRoom = manager.client.getRoom(roomId); if (initialRoom) { + manager.setRoom(roomId); setState((prevState) => ({ ...prevState, loading: false, @@ -168,6 +167,7 @@ export function useVideoRoom(manager, roomId, timeout = 5000) { if (room && room.roomId === roomId) { clearTimeout(timeoutId); manager.client.removeListener("Room", roomCallback); + manager.setRoom(roomId); setState((prevState) => ({ ...prevState, loading: false,