From 9f97d6f20ad7bc4d9563a8f34b364e5f8250c3dc Mon Sep 17 00:00:00 2001 From: Yordan Neshkolov Date: Fri, 29 May 2020 12:52:18 +0300 Subject: [PATCH] NY-10531 WEB Auto translate group chat issue --- .../resource/messages/groups/sagas/GroupsMessages.saga.js | 4 ++-- .../resource/messages/personal/sagas/PersonalMessages.saga.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/resource/messages/groups/sagas/GroupsMessages.saga.js b/src/core/resource/messages/groups/sagas/GroupsMessages.saga.js index 3e89894dc..f1e9479f4 100644 --- a/src/core/resource/messages/groups/sagas/GroupsMessages.saga.js +++ b/src/core/resource/messages/groups/sagas/GroupsMessages.saga.js @@ -680,11 +680,11 @@ function* cursorWatcher() { yield call(cursor, { phoneId: phoneId, groupId: groupId, lastReadMessageId: activeGroupLastMsg, state: globalState }); const { autoTranslateIncoming, autoTranscribe } = yield select(roomListSelectors.getMemberSettings, groupId, phoneId); - if (autoTranslateIncoming && toTranslate.length > 0) { + if (autoTranslateIncoming && toTranslate && toTranslate.length > 0) { yield all(toTranslate.map(m => put(translateActions.translate(m)))); } - if (autoTranscribe && toTranscribe.length > 0) { + if (autoTranscribe && toTranscribe && toTranscribe.length > 0) { yield all(toTranscribe.map(m => put(transcribeActions.transcribe({ msg: m })))); } } diff --git a/src/core/resource/messages/personal/sagas/PersonalMessages.saga.js b/src/core/resource/messages/personal/sagas/PersonalMessages.saga.js index a770dbc29..d2cac76e8 100644 --- a/src/core/resource/messages/personal/sagas/PersonalMessages.saga.js +++ b/src/core/resource/messages/personal/sagas/PersonalMessages.saga.js @@ -566,11 +566,11 @@ function* cursorWatcher() { if (dialog.unread_amount > 0 || dialog.p2p_unread_amount > 0) { yield call(cursor, activeDialogId); - if (request.payload.toTranslate.length > 0) { + if (request.payload.toTranslate && request.payload.toTranslate.length > 0) { yield all(request.payload.toTranslate.map(m => put(translateActions.translate(m)))); } - if (request.payload.toTranscribe.length > 0) { + if (request.payload.toTranscribe && request.payload.toTranscribe.length > 0) { yield all(request.payload.toTranscribe.map(m => put(transcribeActions.transcribe({ msg: m })))); } } -- GitLab