Browse Source

fix(share-video) fix links not being trimmed (#9740)

master
Avram Tudor 4 years ago
parent
commit
9914a5d14a
No account linked to committer's email address

+ 9
- 3
react/features/shared-video/components/AbstractSharedVideoDialog.js View File

56
      * @returns {boolean}
56
      * @returns {boolean}
57
      */
57
      */
58
     _onSetVideoLink(link: string) {
58
     _onSetVideoLink(link: string) {
59
-        if (!link || !link.trim()) {
59
+        if (!link) {
60
             return false;
60
             return false;
61
         }
61
         }
62
 
62
 
63
-        const youtubeId = getYoutubeId(link);
63
+        const trimmedLink = link.trim();
64
+
65
+        if (!trimmedLink) {
66
+            return false;
67
+        }
68
+
69
+        const youtubeId = getYoutubeId(trimmedLink);
64
         const { onPostSubmit } = this.props;
70
         const { onPostSubmit } = this.props;
65
 
71
 
66
-        onPostSubmit(youtubeId || link);
72
+        onPostSubmit(youtubeId || trimmedLink);
67
 
73
 
68
         return true;
74
         return true;
69
     }
75
     }

Loading…
Cancel
Save