Fixed punishment removed message closes #12

This commit is contained in:
Teriuihi 2025-04-19 22:19:08 +02:00
parent 07c77f5485
commit 43b75b8e74
2 changed files with 4 additions and 19 deletions

View File

@ -22,14 +22,14 @@
<td class="historyType" (click)="showDetailedPunishment(entry)">
{{ this.historyFormat.getType(entry) }}
</td>
<td class="historyPlayer" (click)="setSearch(entry.type, entry.username, 'player')">
<td class="historyPlayer" (click)="setSearch(entry.username, 'player')">
<div class="playerContainer">
<img class="avatar" [ngSrc]="this.historyFormat.getAvatarUrl(entry.uuid)" width="25" height="25"
alt="{{entry.username}}'s Minecraft skin">
<span class="username">{{ entry.username }}</span>
</div>
</td>
<td class="historyPlayer" (click)="setSearch(entry.type, entry.punishedBy, 'staff')">
<td class="historyPlayer" (click)="setSearch(entry.punishedBy, 'staff')">
<div class="playerContainer">
<img class="avatar" [ngSrc]="this.historyFormat.getAvatarUrl(entry.punishedByUuid)" width="25" height="25"
alt="{{entry.punishedBy}}'s Minecraft skin">

View File

@ -93,25 +93,10 @@ export class HistoryComponent implements OnInit, OnChanges {
).subscribe();
}
setSearch(type: PunishmentHistory.TypeEnum, name: string, userType: 'player' | 'staff') {
let punishmentType: 'all' | 'ban' | 'mute' | 'kick' | 'warn' = 'all';
switch (type) {
case 'ban':
punishmentType = 'ban';
break;
case 'mute':
punishmentType = 'mute';
break;
case 'kick':
punishmentType = 'kick';
break;
case 'warn':
punishmentType = 'warn';
break;
}
setSearch(name: string, userType: 'player' | 'staff') {
let searchParams: SearchParams = {
userType: userType,
punishmentType: punishmentType,
punishmentType: 'all',
searchTerm: name
}
this.selectItem.emit(searchParams);