mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 06:46:01 +03:00
Fix moderator shield showing incorrectly.
It was being shown for all messages if you're a moderator, instead of just being shown on messages from moderators.
This commit is contained in:
parent
58805f0000
commit
c3f9f24624
1 changed files with 4 additions and 8 deletions
|
@ -7,7 +7,7 @@ import {
|
||||||
messageBubbleColorForHue,
|
messageBubbleColorForHue,
|
||||||
textColorForHue,
|
textColorForHue,
|
||||||
} from '../../utils/user-colors.js';
|
} from '../../utils/user-colors.js';
|
||||||
import { convertToText } from '../../utils/chat.js';
|
import { convertToText, checkIsModerator } from '../../utils/chat.js';
|
||||||
import { SOCKET_MESSAGE_TYPES } from '../../utils/websocket.js';
|
import { SOCKET_MESSAGE_TYPES } from '../../utils/websocket.js';
|
||||||
import { getDiffInDaysFromNow } from '../../utils/helpers.js';
|
import { getDiffInDaysFromNow } from '../../utils/helpers.js';
|
||||||
import ModeratorActions from './moderator-actions.js';
|
import ModeratorActions from './moderator-actions.js';
|
||||||
|
@ -42,12 +42,8 @@ export default class ChatMessageView extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { message, isModerator, accessToken } = this.props;
|
const { message, isModerator, accessToken } = this.props;
|
||||||
const { user, timestamp } = message;
|
const { user, timestamp } = message;
|
||||||
const {
|
const { displayName, displayColor, createdAt } = user;
|
||||||
displayName,
|
const isAuthorModerator = checkIsModerator(message);
|
||||||
displayColor,
|
|
||||||
createdAt,
|
|
||||||
isModerator: isAuthorModerator,
|
|
||||||
} = user;
|
|
||||||
|
|
||||||
const isMessageModeratable =
|
const isMessageModeratable =
|
||||||
isModerator && message.type === SOCKET_MESSAGE_TYPES.CHAT;
|
isModerator && message.type === SOCKET_MESSAGE_TYPES.CHAT;
|
||||||
|
@ -75,7 +71,7 @@ export default class ChatMessageView extends Component {
|
||||||
isMessageModeratable ? 'moderatable' : ''
|
isMessageModeratable ? 'moderatable' : ''
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
const messageAuthorFlair = isModerator
|
const messageAuthorFlair = isAuthorModerator
|
||||||
? html`<img
|
? html`<img
|
||||||
class="flair"
|
class="flair"
|
||||||
title="Moderator"
|
title="Moderator"
|
||||||
|
|
Loading…
Reference in a new issue