Non-user chat messages should always render as visible

This commit is contained in:
Gabe Kangas 2021-12-15 17:28:56 -08:00
parent a747a26c75
commit 734a5a45ef
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA

View File

@ -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);