mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +02:00
🐛 Show short url in invite dialog (#995)
This commit is contained in:
parent
0384b5a33a
commit
040f223d00
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ export function CopyInviteLinkButton() {
|
|||
const [didCopy, setDidCopy] = React.useState(false);
|
||||
const [state, copyToClipboard] = useCopyToClipboard();
|
||||
const poll = usePoll();
|
||||
const inviteLinkWithoutProtocol = poll.inviteLink.replace(/^https?:\/\//, "");
|
||||
|
||||
React.useEffect(() => {
|
||||
if (state.error) {
|
||||
|
@ -41,7 +42,7 @@ export function CopyInviteLinkButton() {
|
|||
{didCopy ? (
|
||||
<Trans i18nKey="copied" />
|
||||
) : (
|
||||
<span className="min-w-0 truncate">{`${window.location.hostname}/invite/${poll.id}`}</span>
|
||||
<span className="min-w-0 truncate">{inviteLinkWithoutProtocol}</span>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue