fix(share-video) fix links not being trimmed (#9740)
This commit is contained in:
parent
fbf9d489f0
commit
9914a5d14a
|
@ -56,14 +56,20 @@ export default class AbstractSharedVideoDialog<S: *> extends Component < Props,
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
_onSetVideoLink(link: string) {
|
_onSetVideoLink(link: string) {
|
||||||
if (!link || !link.trim()) {
|
if (!link) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const youtubeId = getYoutubeId(link);
|
const trimmedLink = link.trim();
|
||||||
|
|
||||||
|
if (!trimmedLink) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const youtubeId = getYoutubeId(trimmedLink);
|
||||||
const { onPostSubmit } = this.props;
|
const { onPostSubmit } = this.props;
|
||||||
|
|
||||||
onPostSubmit(youtubeId || link);
|
onPostSubmit(youtubeId || trimmedLink);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue