Skip to content

Commit

Permalink
fix(share-video) fix links not being trimmed (jitsi#9740)
Browse files Browse the repository at this point in the history
  • Loading branch information
quitrk authored and carotkut94 committed Jan 6, 2022
1 parent 005b1fa commit 5c09a85
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,20 @@ export default class AbstractSharedVideoDialog<S: *> 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;
}
Expand Down

0 comments on commit 5c09a85

Please sign in to comment.