Skip to content

Commit

Permalink
fix calls web dial modal teardown on conference_deleted ws event
Browse files Browse the repository at this point in the history
Changelog: fixed
  • Loading branch information
antonbuks committed Jun 3, 2024
1 parent d9a3b1d commit 13e7418
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
16 changes: 16 additions & 0 deletions webapp/channels/src/actions/kmeet_calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,19 @@ export const closeRingModal = () => {
}
};
};

export function deleteConference(callId: string, channelId: string) {
return (dispatch: DispatchFunc, getState: () => GlobalState) => {
const state = getState();
if (!isDesktopApp() && state.views.modals.modalState[ModalIdentifiers.INCOMING_CALL]?.dialogProps?.channelId === channelId) {
dispatch(closeModal(ModalIdentifiers.INCOMING_CALL));
}
dispatch({
type: ActionTypes.VOICE_CHANNEL_DELETED,
data: {
callID: callId,
channelID: channelId,
},
});
};
}
11 changes: 3 additions & 8 deletions webapp/channels/src/actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ import WebSocketClient from 'client/web_websocket_client';
import {loadPlugin, loadPluginsIfNecessary, removePlugin} from 'plugins';

import {callNoLongerExist, getMyMeets, receivedCall} from './calls';
import {closeRingModal, externalJoinCall} from './kmeet_calls';
import {closeRingModal, deleteConference, externalJoinCall} from './kmeet_calls';
import {handleServerEvent} from './servers_actions';

const dispatch = store.dispatch;
Expand Down Expand Up @@ -1960,13 +1960,8 @@ function handleConferenceDeleted(msg) {
if (isDesktopApp()) {
window.desktopAPI?.closeRingCallWindow?.();
}
doDispatch({
type: ActionTypes.VOICE_CHANNEL_DELETED,
data: {
callID: msg.data.url.split('/').at(-1),
channelID: msg.data.channel_id,
},
});

doDispatch(deleteConference(msg.data.url.split('/').at(-1), msg.data.channel_id));
};
}

Expand Down

0 comments on commit 13e7418

Please sign in to comment.