Merge pull request #1303 from robintown/copy-alias
Make the copy link buttons prefer aliases to room IDs
This commit is contained in:
@@ -93,6 +93,7 @@ export function GroupCallView({
|
|||||||
avatarUrl: avatarUrl!,
|
avatarUrl: avatarUrl!,
|
||||||
roomId: groupCall.room.roomId,
|
roomId: groupCall.room.roomId,
|
||||||
roomName: groupCall.room.name,
|
roomName: groupCall.room.name,
|
||||||
|
roomAlias: groupCall.room.getCanonicalAlias(),
|
||||||
};
|
};
|
||||||
}, [displayName, avatarUrl, groupCall]);
|
}, [displayName, avatarUrl, groupCall]);
|
||||||
|
|
||||||
|
|||||||
@@ -467,7 +467,12 @@ export function InCallView({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{inviteModalState.isOpen && (
|
{inviteModalState.isOpen && (
|
||||||
<InviteModal roomId={groupCall.room.roomId} {...inviteModalProps} />
|
<InviteModal
|
||||||
|
roomIdOrAlias={
|
||||||
|
groupCall.room.getCanonicalAlias() ?? groupCall.room.roomId
|
||||||
|
}
|
||||||
|
{...inviteModalProps}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import { getRoomUrl } from "../matrix-utils";
|
|||||||
import styles from "./InviteModal.module.css";
|
import styles from "./InviteModal.module.css";
|
||||||
|
|
||||||
interface Props extends Omit<ModalProps, "title" | "children"> {
|
interface Props extends Omit<ModalProps, "title" | "children"> {
|
||||||
roomId: string;
|
roomIdOrAlias: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const InviteModal: FC<Props> = ({ roomId, ...rest }) => {
|
export const InviteModal: FC<Props> = ({ roomIdOrAlias, ...rest }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -40,7 +40,7 @@ export const InviteModal: FC<Props> = ({ roomId, ...rest }) => {
|
|||||||
<p>{t("Copy and share this call link")}</p>
|
<p>{t("Copy and share this call link")}</p>
|
||||||
<CopyButton
|
<CopyButton
|
||||||
className={styles.copyButton}
|
className={styles.copyButton}
|
||||||
value={getRoomUrl(roomId)}
|
value={getRoomUrl(roomIdOrAlias)}
|
||||||
data-testid="modal_inviteLink"
|
data-testid="modal_inviteLink"
|
||||||
/>
|
/>
|
||||||
</ModalContent>
|
</ModalContent>
|
||||||
|
|||||||
@@ -112,7 +112,9 @@ export function LobbyView(props: Props) {
|
|||||||
<Body>Or</Body>
|
<Body>Or</Body>
|
||||||
<CopyButton
|
<CopyButton
|
||||||
variant="secondaryCopy"
|
variant="secondaryCopy"
|
||||||
value={getRoomUrl(props.matrixInfo.roomId)}
|
value={getRoomUrl(
|
||||||
|
props.matrixInfo.roomAlias ?? props.matrixInfo.roomId
|
||||||
|
)}
|
||||||
className={styles.copyButton}
|
className={styles.copyButton}
|
||||||
copiedMessage={t("Call link copied")}
|
copiedMessage={t("Call link copied")}
|
||||||
data-testid="lobby_inviteLink"
|
data-testid="lobby_inviteLink"
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export type MatrixInfo = {
|
|||||||
avatarUrl: string;
|
avatarUrl: string;
|
||||||
roomId: string;
|
roomId: string;
|
||||||
roomName: string;
|
roomName: string;
|
||||||
|
roomAlias: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
Reference in New Issue
Block a user