Differentiate between mods and admins in mod log

This commit is contained in:
Felix Ableitner 2022-03-14 20:15:43 +01:00 committed by Dessalines
parent 8f38213780
commit 4846dcf26b

View file

@ -16,6 +16,7 @@ import {
ModRemovePostView, ModRemovePostView,
ModStickyPostView, ModStickyPostView,
ModTransferCommunityView, ModTransferCommunityView,
PersonSafe,
SiteView, SiteView,
UserOperation, UserOperation,
} from "lemmy-js-client"; } from "lemmy-js-client";
@ -399,7 +400,7 @@ export class Modlog extends Component<any, ModlogState> {
{this.isAdminOrMod ? ( {this.isAdminOrMod ? (
<PersonListing person={i.view.moderator} /> <PersonListing person={i.view.moderator} />
) : ( ) : (
<div>{i18n.t("mod")}</div> <div>{this.modOrAdminText(i.view.moderator)}</div>
)} )}
</td> </td>
<td>{this.renderModlogType(i)}</td> <td>{this.renderModlogType(i)}</td>
@ -424,6 +425,16 @@ export class Modlog extends Component<any, ModlogState> {
return isAdmin || isMod; 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 { get documentTitle(): string {
return `Modlog - ${this.state.site_view.site.name}`; return `Modlog - ${this.state.site_view.site.name}`;
} }