From 4846dcf26b1d3395607214609f5a5f761ba492f2 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 14 Mar 2022 20:15:43 +0100 Subject: [PATCH] Differentiate between mods and admins in mod log --- src/shared/components/modlog.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index cc3c7a1ef..e01b81e99 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -16,6 +16,7 @@ import { ModRemovePostView, ModStickyPostView, ModTransferCommunityView, + PersonSafe, SiteView, UserOperation, } from "lemmy-js-client"; @@ -399,7 +400,7 @@ export class Modlog extends Component { {this.isAdminOrMod ? ( ) : ( -
{i18n.t("mod")}
+
{this.modOrAdminText(i.view.moderator)}
)} {this.renderModlogType(i)} @@ -424,6 +425,16 @@ export class Modlog extends Component { return isAdmin || isMod; } + modOrAdminText(person: PersonSafe): Text { + if ( + this.isoData.site_res.admins.map(a => a.person.id).includes(person.id) + ) { + return i18n.t("admin"); + } else { + return i18n.t("mod"); + } + } + get documentTitle(): string { return `Modlog - ${this.state.site_view.site.name}`; }