Merge branch 'livekit' into eslint-upgrade

This commit is contained in:
Robin
2023-10-11 10:30:57 -04:00
100 changed files with 2600 additions and 9682 deletions

View File

@@ -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);
}