瀏覽代碼

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

master
Avram Tudor 4 年之前
父節點
當前提交
9914a5d14a
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 9 行新增3 行删除
  1. 9
    3
      react/features/shared-video/components/AbstractSharedVideoDialog.js

+ 9
- 3
react/features/shared-video/components/AbstractSharedVideoDialog.js 查看文件

@@ -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
     }

Loading…
取消
儲存