diff --git a/src/App.tsx b/src/App.tsx index 0822849d..e9a1129d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -67,9 +67,6 @@ export default function App({ history }: AppProps) { - - - diff --git a/src/home/CallList.tsx b/src/home/CallList.tsx index 545dfade..2cc821b9 100644 --- a/src/home/CallList.tsx +++ b/src/home/CallList.tsx @@ -74,7 +74,10 @@ function CallTile({ }: CallTileProps) { return (
- + { setOnFinished(() => { setClient(client, session); const aliasLocalpart = roomAliasLocalpartFromRoomName(roomName); - const [, serverName] = client.getUserId().split(":"); - history.push(`/room/#${aliasLocalpart}:${serverName}`); + history.push(`/${aliasLocalpart}`); }); setLoading(false); @@ -100,7 +99,7 @@ export const UnauthenticatedView: FC = () => { // Only consider the registration successful if we managed to create the room, too setClient(client, session); - history.push(`/room/${roomIdOrAlias}`); + history.push(`/${roomIdOrAlias.substring(1).split(":")[0]}`); } submit().catch((error) => { diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index 9a7645d2..85a7b313 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -346,15 +346,11 @@ export async function createRoom( // Returns a URL to that will load Element Call with the given room export function getRoomUrl(roomIdOrAlias: string): string { if (roomIdOrAlias.startsWith("#")) { - const [localPart, host] = roomIdOrAlias.replace("#", "").split(":"); - - if (host !== Config.defaultServerName()) { - return `${window.location.protocol}//${window.location.host}/room/${roomIdOrAlias}`; - } else { - return `${window.location.protocol}//${window.location.host}/${localPart}`; - } + return `${window.location.protocol}//${window.location.host}/${ + roomIdOrAlias.substring(1).split(":")[0] + }`; } else { - return `${window.location.protocol}//${window.location.host}/room/#?roomId=${roomIdOrAlias}`; + return `${window.location.protocol}//${window.location.host}?roomId=${roomIdOrAlias}`; } }