fix: check if the app is on foreground before setting call status (#5315)

This commit is contained in:
Gleidson Daniel Silva 2023-11-01 10:21:20 -03:00 committed by GitHub
parent a05790b439
commit 74c2029710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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