From: Dessalines Date: Tue, 21 Feb 2023 20:53:51 +0000 (-0500) Subject: Let any mod feature and lock posts. Fixes #875 (#944) X-Git-Url: http://these/git/readmes/%24%7B%60data:application/README.md?a=commitdiff_plain;h=49acf514e9cca8ef0629444655f53193d6a6e6db;p=lemmy-ui.git Let any mod feature and lock posts. Fixes #875 (#944) * Let any mod feature and lock posts. Fixes #875 * Change to amAdmin --- diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 7580daf..d0e72e4 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -30,6 +30,7 @@ import { UserService, WebSocketService } from "../../services"; import { amAdmin, amCommunityCreator, + amMod, canAdmin, canMod, futureDaysToUnixTime, @@ -614,7 +615,8 @@ export class PostListing extends Component { {this.state.showAdvanced && ( <> {this.showBody && post_view.post.body && this.viewSourceButton} - {this.canModOnSelf_ && ( + {/* Any mod can do these, not limited to hierarchy*/} + {(amMod(this.props.moderators) || amAdmin()) && ( <> {this.lockButton} {this.featureButton} @@ -848,41 +850,40 @@ export class PostListing extends Component { } get featureButton() { - const featured_community = this.props.post_view.post.featured_community; - const label_community = featured_community + const featuredCommunity = this.props.post_view.post.featured_community; + const labelCommunity = featuredCommunity ? i18n.t("unfeature_from_community") : i18n.t("feature_in_community"); - const is_admin = amAdmin(); - const featured_local = this.props.post_view.post.featured_local; - const label_local = featured_local + const featuredLocal = this.props.post_view.post.featured_local; + const labelLocal = featuredLocal ? i18n.t("unfeature_from_local") : i18n.t("feature_in_local"); return ( - {is_admin && ( + {amAdmin() && (