diff --git a/src/global/actions/apiUpdaters/calls.ts b/src/global/actions/apiUpdaters/calls.ts index 8de1b42ae..4e0b23dcc 100644 --- a/src/global/actions/apiUpdaters/calls.ts +++ b/src/global/actions/apiUpdaters/calls.ts @@ -7,6 +7,7 @@ import { ARE_CALLS_SUPPORTED } from '../../../util/environment'; import { notifyAboutCall } from '../../../util/notifications'; import { selectPhoneCallUser } from '../../selectors/calls'; import { initializeSoundsForSafari } from '../ui/calls'; +import { onTickEnd } from '../../../util/schedulers'; addActionHandler('apiUpdate', (global, actions, update) => { switch (update['@type']) { @@ -20,11 +21,13 @@ addActionHandler('apiUpdate', (global, actions, update) => { } } - return updateGroupCall(global, + return updateGroupCall( + global, update.call.id, omit(update.call, ['connectionState']), undefined, - update.call.participantsCount); + update.call.participantsCount, + ); } case 'updateGroupCallChatId': { const chat = selectChat(global, update.chatId); @@ -72,10 +75,13 @@ addActionHandler('apiUpdate', (global, actions, update) => { const isOutgoing = call?.adminId === currentUserId; if (!isOutgoing && call.state === 'requested') { - notifyAboutCall({ - call, - user: selectPhoneCallUser(global)!, + onTickEnd(() => { + notifyAboutCall({ + call, + user: selectPhoneCallUser(global)!, + }); }); + void initializeSoundsForSafari(); return { ...global,