Create room when not found and lowercase name

This commit is contained in:
Robert Long
2022-03-03 16:56:45 -08:00
parent 014b740e47
commit 35fb1e710b
6 changed files with 44 additions and 115 deletions

View File

@@ -2,14 +2,13 @@ import React from "react";
import { useLoadGroupCall } from "./useLoadGroupCall";
import { ErrorView, FullScreenView } from "../FullScreenView";
import { usePageTitle } from "../usePageTitle";
import { isLocalRoomId } from "../matrix-utils";
import { RoomNotFoundView } from "./RoomNotFoundView";
export function GroupCallLoader({ client, roomId, viaServers, children }) {
const { loading, error, groupCall, reload } = useLoadGroupCall(
const { loading, error, groupCall } = useLoadGroupCall(
client,
roomId,
viaServers
viaServers,
true
);
usePageTitle(groupCall ? groupCall.room.name : "Loading...");
@@ -22,18 +21,6 @@ export function GroupCallLoader({ client, roomId, viaServers, children }) {
);
}
if (
error &&
(error.errcode === "M_NOT_FOUND" ||
(error.message &&
error.message.indexOf("Failed to fetch alias") !== -1)) &&
isLocalRoomId(roomId)
) {
return (
<RoomNotFoundView client={client} roomId={roomId} onReload={reload} />
);
}
if (error) {
return <ErrorView error={error} />;
}