diff --git a/src/home/RegisteredView.tsx b/src/home/RegisteredView.tsx index f46376a8..54f52491 100644 --- a/src/home/RegisteredView.tsx +++ b/src/home/RegisteredView.tsx @@ -70,10 +70,9 @@ export function RegisteredView({ client, isPasswordlessUser }: Props) { setError(undefined); setLoading(true); - const [roomIdOrAlias] = await createRoom(client, roomName, ptt); - - if (roomIdOrAlias) { - history.push(`/room/${roomIdOrAlias}`); + const [roomAlias] = await createRoom(client, roomName, ptt); + if (roomAlias) { + history.push(`/room/${roomAlias}`); } } diff --git a/src/home/UnauthenticatedView.tsx b/src/home/UnauthenticatedView.tsx index 0ae7e98d..554d8de6 100644 --- a/src/home/UnauthenticatedView.tsx +++ b/src/home/UnauthenticatedView.tsx @@ -79,9 +79,9 @@ export const UnauthenticatedView: FC = () => { true ); - let roomIdOrAlias: string; + let roomAlias: string; try { - [roomIdOrAlias] = await createRoom(client, roomName, ptt); + [roomAlias] = await createRoom(client, roomName, ptt); } catch (error) { if (!setClient) { throw error; @@ -111,7 +111,7 @@ export const UnauthenticatedView: FC = () => { } setClient({ client, session }); - history.push(`/room/${roomIdOrAlias}`); + history.push(`/room/${roomAlias}`); } submit().catch((error) => { diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 8d5341ac..9afc2ec3 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useMemo, useState } from "react"; import { useHistory } from "react-router-dom"; import { GroupCall, GroupCallState } from "matrix-js-sdk/src/webrtc/groupCall"; import { MatrixClient } from "matrix-js-sdk/src/client"; @@ -50,7 +50,6 @@ interface Props { isEmbedded: boolean; preload: boolean; hideHeader: boolean; - roomIdOrAlias: string; groupCall: GroupCall; } @@ -60,7 +59,6 @@ export function GroupCallView({ isEmbedded, preload, hideHeader, - roomIdOrAlias, groupCall, }: Props) { const { @@ -83,13 +81,14 @@ export function GroupCallView({ }, [groupCall]); const { displayName, avatarUrl } = useProfile(client); - - const matrixInfo: MatrixInfo = { - displayName: displayName!, - avatarUrl: avatarUrl!, - roomName: groupCall.room.name, - roomIdOrAlias, - }; + const matrixInfo = useMemo((): MatrixInfo => { + return { + displayName: displayName!, + avatarUrl: avatarUrl!, + roomId: groupCall.room.roomId, + roomName: groupCall.room.name, + }; + }, [displayName, avatarUrl, groupCall]); useEffect(() => { if (widget && preload) { @@ -243,7 +242,6 @@ export function GroupCallView({ onLeave={onLeave} unencryptedEventsFromUsers={unencryptedEventsFromUsers} hideHeader={hideHeader} - matrixInfo={matrixInfo} userChoices={userChoices} otelGroupCallMembership={otelGroupCallMembership} /> diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index f96b8a92..b8284975 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -68,7 +68,6 @@ import { ElementWidgetActions, widget } from "../widget"; import { GridLayoutMenu } from "./GridLayoutMenu"; import { GroupCallInspector } from "./GroupCallInspector"; import styles from "./InCallView.module.css"; -import { MatrixInfo } from "./VideoPreview"; import { useJoinRule } from "./useJoinRule"; import { ParticipantInfo } from "./useGroupCall"; import { ItemData, TileContent, VideoTile } from "../video-grid/VideoTile"; @@ -118,7 +117,6 @@ export interface InCallViewProps { onLeave: () => void; unencryptedEventsFromUsers: Set; hideHeader: boolean; - matrixInfo: MatrixInfo; otelGroupCallMembership?: OTelGroupCallMembership; } @@ -130,7 +128,6 @@ export function InCallView({ onLeave, unencryptedEventsFromUsers, hideHeader, - matrixInfo, otelGroupCallMembership, }: InCallViewProps) { const { t } = useTranslation(); @@ -397,7 +394,7 @@ export function InCallView({ {!hideHeader && maximisedParticipant === null && (
- + )} {settingsModalState.isOpen && ( @@ -440,10 +437,7 @@ export function InCallView({ /> )} {inviteModalState.isOpen && ( - + )} ); diff --git a/src/room/InviteModal.tsx b/src/room/InviteModal.tsx index 781f2ed6..ce17ac18 100644 --- a/src/room/InviteModal.tsx +++ b/src/room/InviteModal.tsx @@ -23,10 +23,10 @@ import { getRoomUrl } from "../matrix-utils"; import styles from "./InviteModal.module.css"; interface Props extends Omit { - roomIdOrAlias: string; + roomId: string; } -export const InviteModal: FC = ({ roomIdOrAlias, ...rest }) => { +export const InviteModal: FC = ({ roomId, ...rest }) => { const { t } = useTranslation(); return ( @@ -40,7 +40,7 @@ export const InviteModal: FC = ({ roomIdOrAlias, ...rest }) => {

{t("Copy and share this call link")}

diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx index 683e8154..0f07ae7d 100644 --- a/src/room/LobbyView.tsx +++ b/src/room/LobbyView.tsx @@ -81,7 +81,7 @@ export function LobbyView(props: Props) { Or { rageshakeRequestId: string; - roomIdOrAlias: string; + roomId: string; onClose: () => void; } export const RageshakeRequestModal: FC = ({ rageshakeRequestId, - roomIdOrAlias, + roomId, ...rest }) => { const { t } = useTranslation(); @@ -57,7 +57,7 @@ export const RageshakeRequestModal: FC = ({ submitRageshake({ sendLogs: true, rageshakeRequestId, - roomId: roomIdOrAlias, // Possibly not a room ID, but oh well + roomId, }) } disabled={sending} diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index 7f68e6db..afd7beca 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -77,7 +77,6 @@ export const RoomPage: FC = () => { (groupCall: GroupCall) => ( { hideHeader={hideHeader} /> ), - [client, roomIdOrAlias, passwordlessUser, isEmbedded, preload, hideHeader] + [client, passwordlessUser, isEmbedded, preload, hideHeader] ); if (loading || isRegistering) { diff --git a/src/room/VideoPreview.tsx b/src/room/VideoPreview.tsx index 8ec39b00..f76c8e5b 100644 --- a/src/room/VideoPreview.tsx +++ b/src/room/VideoPreview.tsx @@ -34,8 +34,8 @@ import { useDefaultDevices } from "../settings/useSetting"; export type MatrixInfo = { displayName: string; avatarUrl: string; + roomId: string; roomName: string; - roomIdOrAlias: string; }; interface Props {