Set room more reliably
This commit is contained in:
parent
c237c53484
commit
65c65dbb30
1 changed files with 2 additions and 2 deletions
|
@ -144,8 +144,6 @@ export function useVideoRoom(manager, roomId, timeout = 5000) {
|
||||||
error: undefined,
|
error: undefined,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
manager.setRoom(roomId);
|
|
||||||
|
|
||||||
manager.client.joinRoom(roomId).catch((err) => {
|
manager.client.joinRoom(roomId).catch((err) => {
|
||||||
setState((prevState) => ({ ...prevState, loading: false, error: 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);
|
let initialRoom = manager.client.getRoom(roomId);
|
||||||
|
|
||||||
if (initialRoom) {
|
if (initialRoom) {
|
||||||
|
manager.setRoom(roomId);
|
||||||
setState((prevState) => ({
|
setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
@ -168,6 +167,7 @@ export function useVideoRoom(manager, roomId, timeout = 5000) {
|
||||||
if (room && room.roomId === roomId) {
|
if (room && room.roomId === roomId) {
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
manager.client.removeListener("Room", roomCallback);
|
manager.client.removeListener("Room", roomCallback);
|
||||||
|
manager.setRoom(roomId);
|
||||||
setState((prevState) => ({
|
setState((prevState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
Loading…
Reference in a new issue