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:
David Baker
2022-07-20 16:01:29 +01:00
parent 6d7f52d2d6
commit 32b37ed8f0
4 changed files with 42 additions and 8 deletions

View File

@@ -220,8 +220,8 @@ export function isLocalRoomId(roomId: string): boolean {
export async function createRoom(
client: MatrixClient,
name: string
): Promise<string> {
await client.createRoom({
): Promise<[string, string]> {
const result = await client.createRoom({
visibility: Visibility.Private,
preset: Preset.PublicChat,
name,
@@ -251,7 +251,7 @@ export async function createRoom(
},
});
return fullAliasFromRoomName(name, client);
return [fullAliasFromRoomName(name, client), result.room_id];
}
export function getRoomUrl(roomId: string): string {