Calls: Various fixes (#1964)

This commit is contained in:
Alexander Zinchuk 2022-07-20 16:02:23 +02:00
parent 31834d56b5
commit 9533ed449b
4 changed files with 12 additions and 3 deletions

View File

@ -276,7 +276,7 @@ export async function requestCall({
}));
if (!result) {
return;
return false;
}
const call = buildPhoneCall(result.phoneCall);
@ -285,6 +285,8 @@ export async function requestCall({
'@type': 'updatePhoneCall',
call,
});
return true;
}
export function setCallRating({

View File

@ -36,6 +36,8 @@
.meta {
display: flex;
align-items: center;
position: relative;
left: -3px;
}
.duration {

View File

@ -212,7 +212,7 @@ addActionHandler('connectToActiveGroupCall', async (global, actions) => {
}
});
addActionHandler('connectToActivePhoneCall', async (global) => {
addActionHandler('connectToActivePhoneCall', async (global, actions) => {
const { phoneCall } = global;
if (!phoneCall) return;
@ -229,7 +229,11 @@ addActionHandler('connectToActivePhoneCall', async (global) => {
const gAHash = await callApi('requestPhoneCall', [dhConfig])!;
await callApi('requestCall', { user, gAHash, isVideo: phoneCall.isVideo });
const result = await callApi('requestCall', { user, gAHash, isVideo: phoneCall.isVideo });
if (!result) {
actions.hangUp();
}
});
addActionHandler('acceptCall', async (global) => {

View File

@ -73,6 +73,7 @@ addActionHandler('apiUpdate', (global, actions, update) => {
if (phoneCall) {
if (call.state === 'discarded') {
actions.playGroupCallSound({ sound: 'end' });
return {
...global,
...(call.needRating && { ratingPhoneCall: call }),