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

This commit is contained in:
Nik 2018-08-07 18:03:31 +02:00 committed by virtuacoplenny
parent b978851a0f
commit 7e1d97665a
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ MiddlewareRegistry.register(store => next => action => {
* @returns {Object} The value returned by {@code next(action)}.
*/
function _endpointMessageReceived({ dispatch, getState }, next, action) {
if (!(action.json
&& (action.json.type === JSON_TYPE_TRANSCRIPTION_RESULT
|| action.json.type === JSON_TYPE_TRANSLATION_RESULT))) {
return next(action);
}
const json = action.json;
const translationLanguage
= getState()['features/base/conference'].conference