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