Don't allow assigning yourself as moderator

Also fixed split-string (hard to localize).
This commit is contained in:
infinite-persistence 2021-09-24 09:57:24 +08:00
parent e23e9e1387
commit 65d7e478ac
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 6 additions and 5 deletions

View file

@ -1778,7 +1778,8 @@
"Moderators": "Moderators",
"Moderators can block channels on your behalf. Blocked channels will appear in your \"Blocked and Muted\" list.": "Moderators can block channels on your behalf. Blocked channels will appear in your \"Blocked and Muted\" list.",
"Add as moderator": "Add as moderator",
"Assign this user to moderate %channel%": "Assign this user to moderate %channel%",
"Assign this user to moderate %channel%.": "Assign this user to moderate %channel%.",
"Assign this user to moderate your channel.": "Assign this user to moderate your channel.",
"Mute (m)": "Mute (m)",
"Playback Rate (<, >)": "Playback Rate (<, >)",
"Fullscreen (f)": "Fullscreen (f)",

View file

@ -171,16 +171,16 @@ function CommentMenuList(props: Props) {
</MenuItem>
)}
{activeChannelIsCreator && (
{activeChannelIsCreator && activeChannelClaim && activeChannelClaim.permanent_url !== authorUri && (
<MenuItem className="comment__menu-option" onSelect={assignAsModerator}>
<div className="menu__link">
<Icon aria-hidden icon={ICONS.ADD} />
{__('Add as moderator')}
</div>
<span className="comment__menu-help">
{__('Assign this user to moderate %channel%', {
channel: activeChannelClaim ? activeChannelClaim.name : __('your channel'),
})}
{activeChannelClaim
? __('Assign this user to moderate %channel%.', { channel: activeChannelClaim.name })
: __('Assign this user to moderate your channel.')}
</span>
</MenuItem>
)}