Restore call view mode after presentation end

This commit is contained in:
Fedor Indutny 2022-05-25 11:03:27 -07:00 committed by GitHub
parent 9e1528fa24
commit 80c90540f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 289 additions and 51 deletions

View file

@ -5,6 +5,7 @@ import { createSelector } from 'reselect';
import type { StateType } from '../reducer';
import type {
ActiveCallStateType,
CallingStateType,
CallsByConversationType,
DirectCallStateType,
@ -13,6 +14,7 @@ import type {
import { getIncomingCall as getIncomingCallHelper } from '../ducks/calling';
import { getUserUuid } from './user';
import { getOwn } from '../../util/getOwn';
import { CallViewMode } from '../../types/Calling';
import type { UUIDStringType } from '../../types/UUID';
export type CallStateType = DirectCallStateType | GroupCallStateType;
@ -71,3 +73,12 @@ export const getIncomingCall = createSelector(
return getIncomingCallHelper(callsByConversation, ourUuid);
}
);
export const isInSpeakerView = (
call: Pick<ActiveCallStateType, 'viewMode'> | undefined
): boolean => {
return Boolean(
call?.viewMode === CallViewMode.Presentation ||
call?.viewMode === CallViewMode.Speaker
);
};