Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[FIX] Prevent html rendering on messages #701

Merged
merged 4 commits into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { route } from 'preact-router';

import { Livechat } from '../api';
import { CallStatus, isCallOngoing } from '../components/Calls/CallStatus';
import { setCookies, upsert, canRenderMessage } from '../components/helpers';
import { setCookies, upsert, canRenderMessage, parse } from '../components/helpers';
import { store, initialState } from '../store';
import { normalizeAgent } from './api';
import Commands from './commands';
Expand Down Expand Up @@ -175,6 +175,8 @@ Livechat.onMessage(async (message) => {

message = transformAgentInformationOnMessage(message);

message.msg = parse(message.msg);

await store.setState({
messages: upsert(store.state.messages, message, ({ _id }) => _id === message._id, ({ ts }) => ts),
});
Expand Down