From 9914a5d14a9ede95fbbd9674a38401ed24bd1fa1 Mon Sep 17 00:00:00 2001 From: Avram Tudor Date: Wed, 18 Aug 2021 12:09:04 +0300 Subject: [PATCH] fix(share-video) fix links not being trimmed (#9740) --- .../components/AbstractSharedVideoDialog.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/react/features/shared-video/components/AbstractSharedVideoDialog.js b/react/features/shared-video/components/AbstractSharedVideoDialog.js index c54009bdb..69fd55bb4 100644 --- a/react/features/shared-video/components/AbstractSharedVideoDialog.js +++ b/react/features/shared-video/components/AbstractSharedVideoDialog.js @@ -56,14 +56,20 @@ export default class AbstractSharedVideoDialog extends Component < Props, * @returns {boolean} */ _onSetVideoLink(link: string) { - if (!link || !link.trim()) { + if (!link) { return false; } - const youtubeId = getYoutubeId(link); + const trimmedLink = link.trim(); + + if (!trimmedLink) { + return false; + } + + const youtubeId = getYoutubeId(trimmedLink); const { onPostSubmit } = this.props; - onPostSubmit(youtubeId || link); + onPostSubmit(youtubeId || trimmedLink); return true; }