From 2caaa1552098ffe795a13f50483e129f69734625 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 27 Jun 2023 12:23:19 +0100 Subject: [PATCH] Fix username / displayname naming confusion --- src/livekit/useLiveKit.ts | 6 +++--- src/room/GroupCallView.tsx | 2 +- src/room/InCallView.tsx | 2 +- src/room/VideoPreview.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index ceef7ba..b160550 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -18,7 +18,7 @@ export type LiveKitConfig = { sfuUrl: string; jwtUrl: string; roomName: string; - userName: string; + userDisplayName: string; userIdentity: string; }; @@ -29,11 +29,11 @@ export function useLiveKit( const tokenOptions = React.useMemo( () => ({ userInfo: { - name: config.userName, + name: config.userDisplayName, identity: config.userIdentity, }, }), - [config.userName, config.userIdentity] + [config.userDisplayName, config.userIdentity] ); const token = useToken(config.jwtUrl, config.roomName, tokenOptions); diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 5f9c90f..471bfa4 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -85,7 +85,7 @@ export function GroupCallView({ const roomAvatarUrl = useRoomAvatar(groupCall.room); const matrixInfo: MatrixInfo = { - userName: displayName, + displayName, avatarUrl, roomName: groupCall.room.name, roomIdOrAlias, diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index fd94aec..e94a3b2 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -96,7 +96,7 @@ export function ActiveCall(props: ActiveCallProps) { sfuUrl: Config.get().livekit!.server_url, jwtUrl: `${Config.get().livekit!.jwt_service_url}/token`, roomName: props.matrixInfo.roomName, - userName: props.matrixInfo.userName, + userDisplayName: props.matrixInfo.displayName, userIdentity: `${props.client.getUserId()}:${props.client.getDeviceId()}`, }); diff --git a/src/room/VideoPreview.tsx b/src/room/VideoPreview.tsx index f9587eb..ed31f6e 100644 --- a/src/room/VideoPreview.tsx +++ b/src/room/VideoPreview.tsx @@ -31,7 +31,7 @@ import { DeviceChoices, UserChoices } from "../livekit/useLiveKit"; import { useDefaultDevices } from "../settings/useSetting"; export type MatrixInfo = { - userName: string; + displayName: string; avatarUrl: string; roomName: string; roomIdOrAlias: string; @@ -145,7 +145,7 @@ export function VideoPreview({ matrixInfo, onUserChoicesChanged }: Props) { )}