2023-10-16 13:58:51 -04:00
|
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-08-06 12:29:13 -07:00
|
|
|
import { CallState, GroupCallConnectionState } from '../types/Calling';
|
|
|
|
import { CallMode } from '../types/CallDisposition';
|
2023-10-16 13:58:51 -04:00
|
|
|
import type { ActiveCallType } from '../types/Calling';
|
2024-07-02 08:03:02 -07:00
|
|
|
import { isGroupOrAdhocActiveCall } from './isGroupOrAdhocCall';
|
2023-10-16 13:58:51 -04:00
|
|
|
|
|
|
|
export function isReconnecting(activeCall: ActiveCallType): boolean {
|
|
|
|
return (
|
2024-07-02 08:03:02 -07:00
|
|
|
(isGroupOrAdhocActiveCall(activeCall) &&
|
2023-10-16 13:58:51 -04:00
|
|
|
activeCall.connectionState === GroupCallConnectionState.Reconnecting) ||
|
|
|
|
(activeCall.callMode === CallMode.Direct &&
|
|
|
|
activeCall.callState === CallState.Reconnecting)
|
|
|
|
);
|
|
|
|
}
|