Remove unnecessary usage of a roomIdOrAlias

In most cases the `roomId` was used despite the name of the variable.
This commit is contained in:
Daniel Abramov
2023-07-04 18:46:27 +01:00
parent 7f9157bae1
commit f3de341a4b
9 changed files with 27 additions and 37 deletions

View File

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

View File

@@ -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) => {