fix(abuse-list-table): cleanup plugin action

This commit is contained in:
kontrollanten 2024-10-25 09:54:38 +02:00
parent a3b055fba8
commit 8269d6549b
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import debug from 'debug'
import { SortMeta, SharedModule } from 'primeng/api'
import { Component, Input, OnInit, ViewChild } from '@angular/core'
import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { ConfirmService, HooksService, MarkdownService, Notifier, PluginService, RestPagination, RestTable } from '@app/core'
import { AbuseState, AbuseStateType, AdminAbuse } from '@peertube/peertube-models'
@ -56,7 +56,7 @@ const debugLogger = debug('peertube:moderation:AbuseListTableComponent')
DatePipe
]
})
export class AbuseListTableComponent extends RestTable implements OnInit {
export class AbuseListTableComponent extends RestTable implements OnInit, OnDestroy {
@Input() viewType: 'admin' | 'user'
@ViewChild('abuseMessagesModal', { static: true }) abuseMessagesModal: AbuseMessageModalComponent
@ -133,6 +133,10 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
this.initialize()
}
ngOnDestroy () {
this.pluginService.removeAction('admin-abuse-list:load-data')
}
isAdminView () {
return this.viewType === 'admin'
}