From 74c202971011dafed8c7aa303789ebc095d1b278 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Wed, 1 Nov 2023 10:21:20 -0300 Subject: [PATCH] fix: check if the app is on foreground before setting call status (#5315) --- app/sagas/videoConf.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/sagas/videoConf.ts b/app/sagas/videoConf.ts index b3b5fe439..f2b728b15 100644 --- a/app/sagas/videoConf.ts +++ b/app/sagas/videoConf.ts @@ -51,7 +51,8 @@ function* onDirectCall(payload: ICallInfo) { const currentCall = calls.find(c => c.callId === payload.callId); const hasAnotherCall = calls.find(c => c.action === 'call'); if (hasAnotherCall && hasAnotherCall.callId !== payload.callId) return; - if (!currentCall) { + const foreground = yield* appSelector(state => state.app.foreground); + if (!currentCall && foreground) { yield put(setVideoConfCall(payload)); EventEmitter.emit(INAPP_NOTIFICATION_EMITTER, { // @ts-ignore - Component props do not match Event emitter props