summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Kangas <gabek@real-ity.com>2021-12-15 17:28:56 -0800
committerGabe Kangas <gabek@real-ity.com>2021-12-15 17:28:56 -0800
commit734a5a45ef199176f6d3a40856b3d7d336e485cc (patch)
treec835cb89db0a7080750680661433ff5b8ebf8633
parenta747a26c75b82203316ef2b5f19bd3b1ab79b84f (diff)
Non-user chat messages should always render as visible
-rw-r--r--webroot/js/components/chat/chat.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/webroot/js/components/chat/chat.js b/webroot/js/components/chat/chat.js
index 5c7df8ce3..501998f48 100644
--- a/webroot/js/components/chat/chat.js
+++ b/webroot/js/components/chat/chat.js
@@ -23,7 +23,6 @@ const renderableChatStyleMessages = [
SOCKET_MESSAGE_TYPES.SYSTEM,
SOCKET_MESSAGE_TYPES.CHAT,
];
-
export default class Chat extends Component {
constructor(props, context) {
super(props, context);
@@ -199,7 +198,6 @@ export default class Chat extends Component {
id: messageId,
type: messageType,
timestamp: messageTimestamp,
- visible: messageVisible,
} = message;
const { messages: curMessages } = this.state;
const { username, readonly } = this.props;
@@ -208,6 +206,10 @@ export default class Chat extends Component {
(item) => item.id === messageId
);
+ // Allow non-user chat messages to be visible by default.
+ const messageVisible =
+ message.visible || messageType !== SOCKET_MESSAGE_TYPES.CHAT;
+
// check moderator status
if (messageType === SOCKET_MESSAGE_TYPES.CONNECTED_USER_INFO) {
const modStatusUpdate = checkIsModerator(message);