mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-27 04:45:08 +01:00
Calls: Fix inconsistent global usage
This commit is contained in:
parent
2e156d7ef4
commit
4dfbc58976
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user