9a9f9495f1
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
16 lines
645 B
TypeScript
16 lines
645 B
TypeScript
// Copyright 2023 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import { CallState, GroupCallConnectionState } from '../types/Calling';
|
|
import { CallMode } from '../types/CallDisposition';
|
|
import type { ActiveCallType } from '../types/Calling';
|
|
import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall';
|
|
|
|
export function isReconnecting(activeCall: ActiveCallType): boolean {
|
|
return (
|
|
(isGroupOrAdhocActiveCall(activeCall) &&
|
|
activeCall.connectionState === GroupCallConnectionState.Reconnecting) ||
|
|
(activeCall.callMode === CallMode.Direct &&
|
|
activeCall.callState === CallState.Reconnecting)
|
|
);
|
|
}
|