chore: split content into content, system

This commit is contained in:
Paul Makles
2022-04-21 17:46:14 +01:00
parent 231f0cf3f8
commit 0a8e8c9c08
6 changed files with 46 additions and 48 deletions

View File

@@ -228,7 +228,7 @@ export default observer(({ channel }: Props) => {
);
renderer.messages.reverse();
if (msg) {
if (msg?.content) {
// eslint-disable-next-line prefer-const
let [_, toReplace, newText, flags] = content.split(/\//);

View File

@@ -77,11 +77,8 @@ export const SystemMessage = observer(
iconDictionary[data.type as API.SystemMessage["type"]] ??
InfoCircle;
let children;
let children = null;
switch (data.type) {
case "text":
children = <span>{data.content}</span>;
break;
case "user_added":
case "user_remove":
children = (