remove none state on callState. instead set it to undefined
This commit is contained in:
parent
c1db4bf06d
commit
1203f1dc48
|
@ -24,7 +24,6 @@ import { useModuloWithTripleDots } from '../../../hooks/useModuloWithTripleDots'
|
|||
import { CallWindowControls } from './CallButtons';
|
||||
import { SessionSpinner } from '../SessionSpinner';
|
||||
import { DEVICE_DISABLED_DEVICE_ID } from '../../../session/utils/CallManager';
|
||||
// import { useCallAudioLevel } from '../../../hooks/useCallAudioLevel';
|
||||
|
||||
const VideoContainer = styled.div`
|
||||
height: 100%;
|
||||
|
@ -146,8 +145,6 @@ export const InConversationCallContainer = () => {
|
|||
isAudioOutputMuted,
|
||||
} = useVideoCallEventsListener('InConversationCallContainer', true);
|
||||
|
||||
// const isSpeaking = useCallAudioLevel();
|
||||
|
||||
if (videoRefRemote?.current && videoRefLocal?.current) {
|
||||
if (videoRefRemote.current.srcObject !== remoteStream) {
|
||||
videoRefRemote.current.srcObject = remoteStream;
|
||||
|
|
|
@ -176,7 +176,7 @@ export const fillConvoAttributesWithDefaults = (
|
|||
});
|
||||
};
|
||||
|
||||
export type CallState = 'offering' | 'incoming' | 'connecting' | 'ongoing' | 'none' | undefined;
|
||||
export type CallState = 'offering' | 'incoming' | 'connecting' | 'ongoing' | undefined;
|
||||
|
||||
export class ConversationModel extends Backbone.Model<ConversationAttributes> {
|
||||
public updateLastMessage: () => any;
|
||||
|
|
|
@ -22,7 +22,6 @@ import { PubKey } from '../types';
|
|||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { PnServer } from '../../pushnotification';
|
||||
// import { SoundMeter } from '../../../ts/components/session/calling/SoundMeter';
|
||||
import { setIsRinging } from './RingingManager';
|
||||
|
||||
export type InputItem = { deviceId: string; label: string };
|
||||
|
@ -531,8 +530,9 @@ function closeVideoCall() {
|
|||
selectedCameraId = DEVICE_DISABLED_DEVICE_ID;
|
||||
selectedAudioInputId = DEVICE_DISABLED_DEVICE_ID;
|
||||
currentCallUUID = undefined;
|
||||
callVideoListeners();
|
||||
window.inboxStore?.dispatch(setFullScreenCall(false));
|
||||
|
||||
callVideoListeners();
|
||||
}
|
||||
|
||||
function onDataChannelReceivedMessage(ev: MessageEvent<string>) {
|
||||
|
|
|
@ -765,7 +765,7 @@ const conversationsSlice = createSlice({
|
|||
incomingCall(state: ConversationsStateType, action: PayloadAction<{ pubkey: string }>) {
|
||||
const callerPubkey = action.payload.pubkey;
|
||||
const existingCallState = state.conversationLookup[callerPubkey].callState;
|
||||
if (existingCallState !== undefined && existingCallState !== 'none') {
|
||||
if (existingCallState !== undefined) {
|
||||
return state;
|
||||
}
|
||||
const foundConvo = getConversationController().get(callerPubkey);
|
||||
|
@ -784,7 +784,7 @@ const conversationsSlice = createSlice({
|
|||
endCall(state: ConversationsStateType, action: PayloadAction<{ pubkey: string }>) {
|
||||
const callerPubkey = action.payload.pubkey;
|
||||
const existingCallState = state.conversationLookup[callerPubkey].callState;
|
||||
if (!existingCallState || existingCallState === 'none') {
|
||||
if (!existingCallState) {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
@ -796,7 +796,7 @@ const conversationsSlice = createSlice({
|
|||
// we have to update the model itself.
|
||||
// not the db (as we dont want to store that field in it)
|
||||
// and not the redux store directly as it gets overriden by the commit() of the conversationModel
|
||||
foundConvo.callState = 'none';
|
||||
foundConvo.callState = undefined;
|
||||
|
||||
void foundConvo.commit();
|
||||
return state;
|
||||
|
@ -840,7 +840,7 @@ const conversationsSlice = createSlice({
|
|||
startingCallWith(state: ConversationsStateType, action: PayloadAction<{ pubkey: string }>) {
|
||||
const callerPubkey = action.payload.pubkey;
|
||||
const existingCallState = state.conversationLookup[callerPubkey].callState;
|
||||
if (existingCallState && existingCallState !== 'none') {
|
||||
if (existingCallState) {
|
||||
return state;
|
||||
}
|
||||
const foundConvo = getConversationController().get(callerPubkey);
|
||||
|
|
Loading…
Reference in New Issue