Skip to content

Commit

Permalink
Differentiate between mods and admins in mod log
Browse files Browse the repository at this point in the history
  • Loading branch information
Nutomic committed Mar 14, 2022
1 parent aef6a66 commit a0a5dfd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/shared/components/modlog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ModRemovePostView,
ModStickyPostView,
ModTransferCommunityView,
PersonSafe,
SiteView,
UserOperation,
} from "lemmy-js-client";
Expand Down Expand Up @@ -399,7 +400,7 @@ export class Modlog extends Component<any, ModlogState> {
{this.isAdminOrMod ? (
<PersonListing person={i.view.moderator} />
) : (
<div>{i18n.t("mod")}</div>
<div>{this.modOrAdminText(i.view.moderator)}</div>
)}
</td>
<td>{this.renderModlogType(i)}</td>
Expand All @@ -424,6 +425,16 @@ export class Modlog extends Component<any, ModlogState> {
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}`;
}
Expand Down

0 comments on commit a0a5dfd

Please sign in to comment.