浏览代码

fix: only access nested json values when corrent payload type (#3352)

efficient_tiling
Nik 7 年前
父节点
当前提交
7e1d97665a
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      react/features/subtitles/middleware.js

+ 6
- 0
react/features/subtitles/middleware.js 查看文件

65
  * @returns {Object} The value returned by {@code next(action)}.
65
  * @returns {Object} The value returned by {@code next(action)}.
66
  */
66
  */
67
 function _endpointMessageReceived({ dispatch, getState }, next, action) {
67
 function _endpointMessageReceived({ dispatch, getState }, next, action) {
68
+    if (!(action.json
69
+        && (action.json.type === JSON_TYPE_TRANSCRIPTION_RESULT
70
+            || action.json.type === JSON_TYPE_TRANSLATION_RESULT))) {
71
+        return next(action);
72
+    }
73
+
68
     const json = action.json;
74
     const json = action.json;
69
     const translationLanguage
75
     const translationLanguage
70
         = getState()['features/base/conference'].conference
76
         = getState()['features/base/conference'].conference

正在加载...
取消
保存