Fix 'cannot find room' error
We weren't waiting for rooms to arrive down the sync stream after joining them but before trying to use them. More regression details in linked issue. Fixes https://github.com/vector-im/element-call/issues/477
This commit is contained in:
@@ -47,7 +47,7 @@ export function RegisteredView({ client }) {
|
||||
setError(undefined);
|
||||
setLoading(true);
|
||||
|
||||
const roomIdOrAlias = await createRoom(client, roomName, ptt);
|
||||
const [roomIdOrAlias] = await createRoom(client, roomName, ptt);
|
||||
|
||||
if (roomIdOrAlias) {
|
||||
history.push(`/room/${roomIdOrAlias}`);
|
||||
|
||||
@@ -70,7 +70,7 @@ export function UnauthenticatedView() {
|
||||
|
||||
let roomIdOrAlias;
|
||||
try {
|
||||
roomIdOrAlias = await createRoom(client, roomName, ptt);
|
||||
[roomIdOrAlias] = await createRoom(client, roomName, ptt);
|
||||
} catch (error) {
|
||||
if (error.errcode === "M_ROOM_IN_USE") {
|
||||
setOnFinished(() => () => {
|
||||
|
||||
Reference in New Issue
Block a user