- constructor (
- private notifier: Notifier,
- private blocklistService: BlocklistService,
- private i18n: I18n
- ) {
- super()
- }
-
- ngOnInit () {
- this.initialize()
- }
-
- unblockAccount (accountBlock: AccountBlock) {
- const blockedAccount = accountBlock.blockedAccount
-
- this.blocklistService.unblockAccountByUser(blockedAccount)
- .subscribe(
- () => {
- this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: blockedAccount.nameWithHost }))
-
- this.loadData()
- }
- )
- }
-
- protected loadData () {
- return this.blocklistService.getUserAccountBlocklist(this.pagination, this.sort)
- .subscribe(
- resultList => {
- this.blockedAccounts = resultList.data
- this.totalRecords = resultList.total
- },
-
- err => this.notifier.error(err.message)
- )