mirror of
https://github.com/wassname/talk.git
synced 2026-08-08 11:28:12 +08:00
Site Moderator Fixes (#3054)
* fix: disable banning for site moderators * fix: fixed redirect issue for site moderators
This commit is contained in:
@@ -84,8 +84,13 @@ const ModerateContainer: FunctionComponent<Props> = ({
|
||||
|
||||
// If we've loaded a specific story, we'll have the site on that story too,
|
||||
// so check if we're allowed to moderate it.
|
||||
if (data.story && !data.story.site.canModerate) {
|
||||
redirect();
|
||||
if (data.story) {
|
||||
if (!data.story.site.canModerate) {
|
||||
redirect();
|
||||
return;
|
||||
}
|
||||
|
||||
// The viewer can moderate this site on the story!
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -90,7 +90,7 @@ const ModerationActionsContainer: FunctionComponent<Props> = ({
|
||||
const showBanOption =
|
||||
!comment.author || !comment.author.id || viewer === null
|
||||
? false
|
||||
: comment.author.id !== viewer.id;
|
||||
: comment.author.id !== viewer.id && !viewer.moderationScopes?.scoped;
|
||||
const isQA = story.settings.mode === GQLSTORY_MODE.QA;
|
||||
|
||||
return (
|
||||
@@ -285,6 +285,9 @@ const enhanced = withFragmentContainer<Props>({
|
||||
viewer: graphql`
|
||||
fragment ModerationActionsContainer_viewer on User {
|
||||
id
|
||||
moderationScopes {
|
||||
scoped
|
||||
}
|
||||
}
|
||||
`,
|
||||
})(ModerationActionsContainer);
|
||||
|
||||
Reference in New Issue
Block a user