diff --git a/react/features/base/premeeting/components/web/CopyMeetingUrl.js b/react/features/base/premeeting/components/web/CopyMeetingUrl.js index 7725ab426..ed956ea22 100644 --- a/react/features/base/premeeting/components/web/CopyMeetingUrl.js +++ b/react/features/base/premeeting/components/web/CopyMeetingUrl.js @@ -6,7 +6,7 @@ import { getCurrentConferenceUrl } from '../../../connection'; import { translate } from '../../../i18n'; import { Icon, IconCopy, IconCheck } from '../../../icons'; import { connect } from '../../../redux'; -import { copyText } from '../../../util'; +import { copyText, getDecodedURI } from '../../../util'; type Props = { @@ -156,7 +156,7 @@ class CopyMeetingUrl extends Component { className = { `url ${showLinkCopied ? 'done' : ''}` } onClick = { _copyUrl } >
- { !showCopyLink && !showLinkCopied && url } + { !showCopyLink && !showLinkCopied && getDecodedURI(url) } { showCopyLink && t('prejoin.copyAndShare') } { showLinkCopied && t('prejoin.linkCopied') }
diff --git a/react/features/base/util/uri.js b/react/features/base/util/uri.js index 4ecaa8589..7e099c2af 100644 --- a/react/features/base/util/uri.js +++ b/react/features/base/util/uri.js @@ -591,3 +591,13 @@ export function addHashParamsToURL(url: URL, hashParamsToAdd: Object = {}) { return url; } + +/** + * Returns the decoded URI. + * + * @param {string} uri - The URI to decode. + * @returns {string} + */ +export function getDecodedURI(uri: string) { + return decodeURI(uri.replace(/^https?:\/\//i, '')); +} diff --git a/react/features/invite/components/add-people-dialog/web/CopyMeetingLinkSection.js b/react/features/invite/components/add-people-dialog/web/CopyMeetingLinkSection.js index baacd2db7..6dc327d80 100644 --- a/react/features/invite/components/add-people-dialog/web/CopyMeetingLinkSection.js +++ b/react/features/invite/components/add-people-dialog/web/CopyMeetingLinkSection.js @@ -4,7 +4,7 @@ import React, { useState } from 'react'; import { translate } from '../../../../base/i18n'; import { Icon, IconCheck, IconCopy } from '../../../../base/icons'; -import { copyText } from '../../../../base/util'; +import { copyText, getDecodedURI } from '../../../../base/util'; type Props = { @@ -82,7 +82,7 @@ function CopyMeetingLinkSection({ t, url }: Props) { ); } - const displayUrl = decodeURI(url.replace(/^https?:\/\//i, '')); + const displayUrl = getDecodedURI(url); return ( <>