Ver código fonte

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

master
Avram Tudor 3 anos atrás
pai
commit
9914a5d14a
Nenhuma conta vinculada ao e-mail do autor do commit

+ 9
- 3
react/features/shared-video/components/AbstractSharedVideoDialog.js Ver arquivo

@@ -56,14 +56,20 @@ export default class AbstractSharedVideoDialog<S: *> extends Component < Props,
56 56
      * @returns {boolean}
57 57
      */
58 58
     _onSetVideoLink(link: string) {
59
-        if (!link || !link.trim()) {
59
+        if (!link) {
60 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 70
         const { onPostSubmit } = this.props;
65 71
 
66
-        onPostSubmit(youtubeId || link);
72
+        onPostSubmit(youtubeId || trimmedLink);
67 73
 
68 74
         return true;
69 75
     }

Carregando…
Cancelar
Salvar