From c45247c264d339843670f52a4058945146ce6f50 Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 28 Feb 2025 15:43:21 +0100 Subject: [PATCH] review --- locales/en/app.json | 2 +- src/room/GroupCallView.tsx | 23 +++++++---------------- src/settings/DeveloperSettingsTab.tsx | 2 +- src/utils/errors.ts | 7 +------ src/utils/matrix.ts | 2 +- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/locales/en/app.json b/locales/en/app.json index bbcad391..d80a8502 100644 --- a/locales/en/app.json +++ b/locales/en/app.json @@ -71,7 +71,7 @@ "matrix_id": "Matrix ID: {{id}}", "show_connection_stats": "Show connection statistics", "show_non_member_tiles": "Show tiles for non-member media", - "use_NewMembershipmanager": "Use the new implementation of the call MembershipManager" + "use_new_membership_manager": "Use the new implementation of the call MembershipManager" }, "disconnected_banner": "Connectivity to the server has been lost.", "error": { diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 18bdbdcc..ed8f77ae 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -160,7 +160,7 @@ export const GroupCallView: FC = ({ const roomName = useRoomName(room); const roomAvatar = useRoomAvatar(room); const { perParticipantE2EE, returnToLobby } = useUrlParams(); - const e2eeSystem = useRoomEncryptionSystem(rtcSession.room.roomId); + const e2eeSystem = useRoomEncryptionSystem(room.roomId); const [newMembershipManager] = useSetting(useNewMembershipManagerSetting); usePageTitle(roomName); @@ -170,22 +170,13 @@ export const GroupCallView: FC = ({ userId: client.getUserId()!, displayName: displayName!, avatarUrl: avatarUrl!, - roomId: rtcSession.room.roomId, + roomId: room.roomId, roomName, roomAlias: room.getCanonicalAlias(), roomAvatar, e2eeSystem, }; - }, [ - client, - displayName, - avatarUrl, - rtcSession.room.roomId, - roomName, - room, - roomAvatar, - e2eeSystem, - ]); + }, [client, displayName, avatarUrl, roomName, room, roomAvatar, e2eeSystem]); // Count each member only once, regardless of how many devices they use const participantCount = useMemo( @@ -319,8 +310,7 @@ export const GroupCallView: FC = ({ ]); const [left, setLeft] = useState(false); - const [error, setError] = - useState(null); + const [error, setError] = useState(null); const navigate = useNavigate(); const onLeave = useCallback( @@ -334,7 +324,7 @@ export const GroupCallView: FC = ({ // Otherwise the iFrame gets killed before the callEnded event got tracked. const posthogRequest = new Promise((resolve) => { PosthogAnalytics.instance.eventCallEnded.track( - rtcSession.room.roomId, + room.roomId, rtcSession.memberships.length, sendInstantly, rtcSession, @@ -363,11 +353,12 @@ export const GroupCallView: FC = ({ }); }, [ + leaveSoundContext, widget, rtcSession, + room.roomId, isPasswordlessUser, confineToRoom, - leaveSoundContext, navigate, ], ); diff --git a/src/settings/DeveloperSettingsTab.tsx b/src/settings/DeveloperSettingsTab.tsx index 31f40a58..7f5e236b 100644 --- a/src/settings/DeveloperSettingsTab.tsx +++ b/src/settings/DeveloperSettingsTab.tsx @@ -143,7 +143,7 @@ export const DeveloperSettingsTab: FC = ({ client, livekitRoom }) => { ): void => { diff --git a/src/utils/errors.ts b/src/utils/errors.ts index c02d7f6f..05b7dedc 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -77,11 +77,6 @@ export class ConnectionLostError extends ElementCallError { export class RTCSessionError extends ElementCallError { public constructor(code: ErrorCode, message: string) { - super( - "RTCSession Error", - code, - ErrorCategory.RTC_SESSION_FAILIOUR, - message, - ); + super("RTCSession Error", code, ErrorCategory.RTC_SESSION_FAILURE, message); } } diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index ee0158cc..f1801b97 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -69,7 +69,7 @@ async function waitForSync(client: MatrixClient): Promise { * otherwise rust crypto will throw since it is not ready to initialize a new session. * If another client is running make sure `.logout()` is called before executing this function. * @param clientOptions Object of options passed through to the client - * @param restore If the rust crypto should be reset before the cient initialization or + * @param restore If the rust crypto should be reset before the client initialization or * if the initialization should try to restore the crypto state from the indexDB. * @returns The MatrixClient instance */