ソースを参照

fix(chat): prevent empty messages

j8
Leonard Kim 6年前
コミット
81d4f694b7
1個のファイルの変更6行の追加2行の削除
  1. 6
    2
      react/features/chat/components/web/ChatInput.js

+ 6
- 2
react/features/chat/components/web/ChatInput.js ファイルの表示

@@ -157,9 +157,13 @@ class ChatInput extends Component<Props, State> {
157 157
             && event.shiftKey === false) {
158 158
             event.preventDefault();
159 159
 
160
-            this.props.dispatch(sendMessage(this.state.message));
160
+            const trimmed = this.state.message.trim();
161 161
 
162
-            this.setState({ message: '' });
162
+            if (trimmed) {
163
+                this.props.dispatch(sendMessage(trimmed));
164
+
165
+                this.setState({ message: '' });
166
+            }
163 167
         }
164 168
     }
165 169
 

読み込み中…
キャンセル
保存