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

@@ -20,7 +20,7 @@ import { Room } from "matrix-js-sdk";
import { Modal } from "../Modal";
import { CopyButton } from "../button";
import { getRoomUrl } from "../matrix-utils";
import { getAbsoluteRoomUrl } from "../matrix-utils";
import styles from "./ShareModal.module.css";
import { useRoomSharedKey } from "../e2ee/sharedKeyManagement";
@@ -39,7 +39,11 @@ export const ShareModal: FC<Props> = ({ room, open, onDismiss }) => {
<p>{t("Copy and share this call link")}</p>
<CopyButton
className={styles.copyButton}
value={getRoomUrl(room.roomId, room.name, roomSharedKey ?? undefined)}
value={getAbsoluteRoomUrl(
room.roomId,
room.name,
roomSharedKey ?? undefined
)}
data-testid="modal_inviteLink"
/>
</Modal>