Skip to content

Commit

Permalink
feat: sanitize messages before export
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jul 21, 2022
1 parent 13f9834 commit eca9152
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Chatbox/ExportChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ToolVariants,
ToolVariantsType,
} from '../../types';
import { normalizeMentions } from '../../utils/mentions';

const useStyles = makeStyles({
link: {
Expand Down Expand Up @@ -52,7 +53,11 @@ const ExportChat: FC<Props> = ({ variant = ToolVariants.ICON, text }) => {
const creatorName =
members.find((m) => m.id === message.creator)?.name ||
DEFAULT_USER_NAME;
return { ...message, creatorName };
return {
...message,
body: normalizeMentions(message.body)!,
creatorName,
};
});
// render nothing if there is no data
if (!csvMessages.length) {
Expand Down

0 comments on commit eca9152

Please sign in to comment.