diff --git a/react/features/base/premeeting/components/web/CopyMeetingUrl.js b/react/features/base/premeeting/components/web/CopyMeetingUrl.js index 1094533a0..7725ab426 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 logger from '../../logger'; +import { copyText } from '../../../util'; type Props = { @@ -41,8 +41,6 @@ const COPY_TIMEOUT = 2000; */ class CopyMeetingUrl extends Component { - textarea: Object; - /** * Initializes a new {@code Prejoin} instance. * @@ -51,7 +49,6 @@ class CopyMeetingUrl extends Component { constructor(props) { super(props); - this.textarea = React.createRef(); this.state = { showCopyLink: false, showLinkCopied: false @@ -71,16 +68,11 @@ class CopyMeetingUrl extends Component { * @returns {void} */ _copyUrl() { - const textarea = this.textarea.current; + const success = copyText(this.props.url); - try { - textarea.select(); - document.execCommand('copy'); - textarea.blur(); + if (success) { this._showLinkCopied(); window.setTimeout(this._hideLinkCopied, COPY_TIMEOUT); - } catch (err) { - logger.error('error when copying the meeting url'); } } @@ -173,11 +165,6 @@ class CopyMeetingUrl extends Component { size = { 24 } src = { src } /> -