Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Special Characters in Messages show in Unicode #155

Merged
merged 6 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions build/5.chunk.2cf18.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/5.chunk.2cf18.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions build/5.chunk.d45dc.js

This file was deleted.

1 change: 0 additions & 1 deletion build/5.chunk.d45dc.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions build/bundle.2fcbc.js → build/bundle.9e8cc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/bundle.2fcbc.js.map → build/bundle.9e8cc.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta charset="utf-8"><title></title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><script src="livechat/0.chunk.7df7a.js"></script><script src="livechat/polyfills.b9285.js"></script><script src="livechat/vendors~bundle.chunk.b4ff7.js"></script><script src="livechat/bundle.2fcbc.js"></script></body></html>
<!doctype html><html><head><meta charset="utf-8"><title></title><meta name="viewport" content="width=device-width,initial-scale=1"></head><body><script src="livechat/0.chunk.7df7a.js"></script><script src="livechat/polyfills.b9285.js"></script><script src="livechat/vendors~bundle.chunk.b4ff7.js"></script><script src="livechat/bundle.9e8cc.js"></script></body></html>
6 changes: 3 additions & 3 deletions src/components/Composer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { h, Component } from 'preact';

import { createClassName, parse } from '../helpers';
import { createClassName } from '../helpers';
import styles from './styles.scss';

const findLastTextNode = (node) => {
Expand Down Expand Up @@ -76,7 +76,7 @@ export class Composer extends Component {
.map((item) => new Promise((resolve) => item.getAsString(resolve))),
);

texts.forEach((text) => this.pasteText(parse(text)));
texts.forEach((text) => this.pasteText(text));
}

handleDrop = (onUpload) => async (event) => {
Expand All @@ -99,7 +99,7 @@ export class Composer extends Component {
items.filter((item) => item.kind === 'string' && /^text\/plain/.test(item.type))
.map((item) => new Promise((resolve) => item.getAsString(resolve))),
);
texts.forEach((text) => this.pasteText(parse(text)));
texts.forEach((text) => this.pasteText(text));
}

handleClick = () => {
Expand Down
4 changes: 1 addition & 3 deletions 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, parse } from '../components/helpers';
import { setCookies, upsert, canRenderMessage } from '../components/helpers';
import { store, initialState } from '../store';
import { normalizeAgent } from './api';
import Commands from './commands';
Expand Down Expand Up @@ -280,8 +280,6 @@ 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