]> Untitled Git - lemmy-ui.git/commitdiff
Do local community checks for buttons. Fixes #918 (#948)
authorDessalines <dessalines@users.noreply.github.com>
Tue, 21 Feb 2023 20:52:57 +0000 (15:52 -0500)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2023 20:52:57 +0000 (15:52 -0500)
src/shared/components/comment/comment-node.tsx

index 50da45614ef9f9ba9b5043a1c1136e737ec1905b..6f903b48a855673630a4ca36babfba53c5299d3a 100644 (file)
@@ -163,27 +163,29 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
         ? i18n.t("purge_comment")
         : `${i18n.t("purge")} ${cv.creator.name}`;
 
-    let canMod_ = canMod(
-      cv.creator.id,
-      this.props.moderators,
-      this.props.admins
-    );
-    let canModOnSelf = canMod(
-      cv.creator.id,
-      this.props.moderators,
-      this.props.admins,
-      UserService.Instance.myUserInfo,
-      true
-    );
-    let canAdmin_ = canAdmin(cv.creator.id, this.props.admins);
-    let canAdminOnSelf = canAdmin(
-      cv.creator.id,
-      this.props.admins,
-      UserService.Instance.myUserInfo,
-      true
-    );
+    let canMod_ =
+      canMod(cv.creator.id, this.props.moderators, this.props.admins) &&
+      cv.community.local;
+    let canModOnSelf =
+      canMod(
+        cv.creator.id,
+        this.props.moderators,
+        this.props.admins,
+        UserService.Instance.myUserInfo,
+        true
+      ) && cv.community.local;
+    let canAdmin_ =
+      canAdmin(cv.creator.id, this.props.admins) && cv.community.local;
+    let canAdminOnSelf =
+      canAdmin(
+        cv.creator.id,
+        this.props.admins,
+        UserService.Instance.myUserInfo,
+        true
+      ) && cv.community.local;
     let isMod_ = isMod(cv.creator.id, this.props.moderators);
-    let isAdmin_ = isAdmin(cv.creator.id, this.props.admins);
+    let isAdmin_ =
+      isAdmin(cv.creator.id, this.props.admins) && cv.community.local;
     let amCommunityCreator_ = amCommunityCreator(
       cv.creator.id,
       this.props.moderators