Factor out common function to generate the URLs

This commit is contained in:
David Baker
2023-09-19 18:55:33 +01:00
parent 2753f04f0b
commit 83fdb094d5
6 changed files with 43 additions and 15 deletions

View File

@@ -27,6 +27,7 @@ import { FieldRow, InputField, ErrorMessage } from "../input/Input";
import { Button } from "../button";
import {
createRoom,
getRelativeRoomUrl,
roomAliasLocalpartFromRoomName,
sanitiseRoomNameInput,
} from "../matrix-utils";
@@ -125,7 +126,7 @@ export const UnauthenticatedView: FC = () => {
}
setClient({ client, session });
history.push(`/room/#?roomId=${roomId}`);
history.push(getRelativeRoomUrl(roomId, roomName));
}
submit().catch((error) => {