Hide call buttons when on call

This commit is contained in:
Evan Hahn 2020-10-30 12:52:21 -05:00 committed by Evan Hahn
parent a7854c6083
commit decc93532b
18 changed files with 622 additions and 366 deletions

View file

@ -96,6 +96,21 @@ export type SetRendererCanvasType = {
element: React.RefObject<HTMLCanvasElement> | undefined;
};
// Helpers
export function isCallActive({
callDetails,
callState,
}: CallingStateType): boolean {
return Boolean(
callDetails &&
((!callDetails.isIncoming &&
(callState === CallState.Prering || callState === CallState.Ringing)) ||
callState === CallState.Accepted ||
callState === CallState.Reconnecting)
);
}
// Actions
const ACCEPT_CALL = 'calling/ACCEPT_CALL';
@ -522,7 +537,7 @@ export type ActionsType = typeof actions;
// Reducer
function getEmptyState(): CallingStateType {
export function getEmptyState(): CallingStateType {
return {
availableCameras: [],
availableMicrophones: [],