mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-12-25 18:36:24 +00:00
Differentiate between mods and admins in mod log (#597)
This commit is contained in:
parent
8f38213780
commit
3fe9dc0d7b
|
@ -16,6 +16,7 @@ import {
|
|||
ModRemovePostView,
|
||||
ModStickyPostView,
|
||||
ModTransferCommunityView,
|
||||
PersonSafe,
|
||||
SiteView,
|
||||
UserOperation,
|
||||
} from "lemmy-js-client";
|
||||
|
@ -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>
|
||||
|
@ -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}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue