fix(abuse-list-table): cleanup plugin action
This commit is contained in:
parent
a3b055fba8
commit
8269d6549b
|
@ -1,6 +1,6 @@
|
||||||
import debug from 'debug'
|
import debug from 'debug'
|
||||||
import { SortMeta, SharedModule } from 'primeng/api'
|
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 { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { ConfirmService, HooksService, MarkdownService, Notifier, PluginService, RestPagination, RestTable } from '@app/core'
|
import { ConfirmService, HooksService, MarkdownService, Notifier, PluginService, RestPagination, RestTable } from '@app/core'
|
||||||
import { AbuseState, AbuseStateType, AdminAbuse } from '@peertube/peertube-models'
|
import { AbuseState, AbuseStateType, AdminAbuse } from '@peertube/peertube-models'
|
||||||
|
@ -56,7 +56,7 @@ const debugLogger = debug('peertube:moderation:AbuseListTableComponent')
|
||||||
DatePipe
|
DatePipe
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AbuseListTableComponent extends RestTable implements OnInit {
|
export class AbuseListTableComponent extends RestTable implements OnInit, OnDestroy {
|
||||||
@Input() viewType: 'admin' | 'user'
|
@Input() viewType: 'admin' | 'user'
|
||||||
|
|
||||||
@ViewChild('abuseMessagesModal', { static: true }) abuseMessagesModal: AbuseMessageModalComponent
|
@ViewChild('abuseMessagesModal', { static: true }) abuseMessagesModal: AbuseMessageModalComponent
|
||||||
|
@ -133,6 +133,10 @@ export class AbuseListTableComponent extends RestTable implements OnInit {
|
||||||
this.initialize()
|
this.initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnDestroy () {
|
||||||
|
this.pluginService.removeAction('admin-abuse-list:load-data')
|
||||||
|
}
|
||||||
|
|
||||||
isAdminView () {
|
isAdminView () {
|
||||||
return this.viewType === 'admin'
|
return this.viewType === 'admin'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue