Merge branch 'livekit' into eslint-upgrade
This commit is contained in:
@@ -71,9 +71,11 @@ const CallTile: FC<CallTileProps> = ({ name, avatarUrl, room }) => {
|
||||
return (
|
||||
<div className={styles.callTile}>
|
||||
<Link
|
||||
// note we explicitly omit the password here as we don't want it on this link because
|
||||
// it's just for the user to navigate around and not for sharing
|
||||
to={getRelativeRoomUrl(room.roomId, room.name)}
|
||||
to={getRelativeRoomUrl(
|
||||
room.roomId,
|
||||
room.name,
|
||||
roomSharedKey ?? undefined
|
||||
)}
|
||||
className={styles.callTileLink}
|
||||
>
|
||||
<Avatar id={room.roomId} name={name} size={Size.LG} src={avatarUrl} />
|
||||
|
||||
@@ -17,9 +17,9 @@ limitations under the License.
|
||||
import { useState, useCallback, FormEvent, FormEventHandler, FC } from "react";
|
||||
import { useHistory } from "react-router-dom";
|
||||
import { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import { randomString } from "matrix-js-sdk/src/randomstring";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Heading } from "@vector-im/compound-web";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import {
|
||||
createRoom,
|
||||
@@ -41,8 +41,6 @@ import { Form } from "../form/Form";
|
||||
import { useEnableE2EE, useOptInAnalytics } from "../settings/useSetting";
|
||||
import { AnalyticsNotice } from "../analytics/AnalyticsNotice";
|
||||
import { E2EEBanner } from "../E2EEBanner";
|
||||
import { setLocalStorageItem } from "../useLocalStorage";
|
||||
import { getRoomSharedKeyLocalStorageKey } from "../e2ee/sharedKeyManagement";
|
||||
|
||||
interface Props {
|
||||
client: MatrixClient;
|
||||
@@ -76,18 +74,19 @@ export const RegisteredView: FC<Props> = ({ client }) => {
|
||||
setError(undefined);
|
||||
setLoading(true);
|
||||
|
||||
const roomId = (
|
||||
await createRoom(client, roomName, e2eeEnabled ?? false)
|
||||
)[1];
|
||||
const createRoomResult = await createRoom(
|
||||
client,
|
||||
roomName,
|
||||
e2eeEnabled ?? false
|
||||
);
|
||||
|
||||
if (e2eeEnabled) {
|
||||
setLocalStorageItem(
|
||||
getRoomSharedKeyLocalStorageKey(roomId),
|
||||
randomString(32)
|
||||
);
|
||||
}
|
||||
|
||||
history.push(getRelativeRoomUrl(roomId, roomName));
|
||||
history.push(
|
||||
getRelativeRoomUrl(
|
||||
createRoomResult.roomId,
|
||||
roomName,
|
||||
createRoomResult.password
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
submit().catch((error) => {
|
||||
@@ -97,7 +96,7 @@ export const RegisteredView: FC<Props> = ({ client }) => {
|
||||
setError(undefined);
|
||||
setJoinExistingCallModalOpen(true);
|
||||
} else {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
setLoading(false);
|
||||
setError(error);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { useHistory } from "react-router-dom";
|
||||
import { randomString } from "matrix-js-sdk/src/randomstring";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import { Heading } from "@vector-im/compound-web";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { useClient } from "../ClientContext";
|
||||
import { Header, HeaderLogo, LeftNav, RightNav } from "../Header";
|
||||
@@ -43,8 +44,6 @@ import { AnalyticsNotice } from "../analytics/AnalyticsNotice";
|
||||
import { useEnableE2EE, useOptInAnalytics } from "../settings/useSetting";
|
||||
import { Config } from "../config/Config";
|
||||
import { E2EEBanner } from "../E2EEBanner";
|
||||
import { getRoomSharedKeyLocalStorageKey } from "../e2ee/sharedKeyManagement";
|
||||
import { setLocalStorageItem } from "../useLocalStorage";
|
||||
|
||||
export const UnauthenticatedView: FC = () => {
|
||||
const { setClient } = useClient();
|
||||
@@ -86,18 +85,13 @@ export const UnauthenticatedView: FC = () => {
|
||||
true
|
||||
);
|
||||
|
||||
let roomId: string;
|
||||
let createRoomResult;
|
||||
try {
|
||||
roomId = (
|
||||
await createRoom(client, roomName, e2eeEnabled ?? false)
|
||||
)[1];
|
||||
|
||||
if (e2eeEnabled) {
|
||||
setLocalStorageItem(
|
||||
getRoomSharedKeyLocalStorageKey(roomId),
|
||||
randomString(32)
|
||||
);
|
||||
}
|
||||
createRoomResult = await createRoom(
|
||||
client,
|
||||
roomName,
|
||||
e2eeEnabled ?? false
|
||||
);
|
||||
} catch (error) {
|
||||
if (!setClient) {
|
||||
throw error;
|
||||
@@ -126,11 +120,17 @@ export const UnauthenticatedView: FC = () => {
|
||||
}
|
||||
|
||||
setClient({ client, session });
|
||||
history.push(getRelativeRoomUrl(roomId, roomName));
|
||||
history.push(
|
||||
getRelativeRoomUrl(
|
||||
createRoomResult.roomId,
|
||||
roomName,
|
||||
createRoomResult.password
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
submit().catch((error) => {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
setLoading(false);
|
||||
setError(error);
|
||||
reset();
|
||||
|
||||
Reference in New Issue
Block a user