Skip to content
Snippets Groups Projects
Unverified Commit 443c63a5 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

chore(livechat): stop calling twice closeChat (#32025)

parent 13fbf57c
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,14 @@ export const closeChat = async ({ transcriptRequested } = {}) => {
await handleTranscript();
}
const { department, config: { settings: { clearLocalStorageWhenChatEnded } = {} } = {} } = store.state;
const { room, department, config: { settings: { clearLocalStorageWhenChatEnded } = {} } = {} } = store.state;
if (!room) {
console.warn('closeChat called without a room');
return;
}
await store.setState({ room: null });
if (clearLocalStorageWhenChatEnded) {
// exclude UI-affecting flags
......@@ -101,7 +108,7 @@ export const processIncomingCallMessage = async (message) => {
const processMessage = async (message) => {
if (message.t === 'livechat-close') {
closeChat(message);
await closeChat(message);
} else if (message.t === 'command') {
commands[message.msg] && commands[message.msg]();
} else if (message.webRtcCallEndTs) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment