aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+actors/actors.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+actors/actors.component.ts')
-rw-r--r--client/src/app/+actors/actors.component.ts41
1 files changed, 0 insertions, 41 deletions
diff --git a/client/src/app/+actors/actors.component.ts b/client/src/app/+actors/actors.component.ts
deleted file mode 100644
index 74fbe7dea..000000000
--- a/client/src/app/+actors/actors.component.ts
+++ /dev/null
@@ -1,41 +0,0 @@
1import { Component, OnInit } from '@angular/core'
2import { empty } from 'rxjs'
3import { catchError } from 'rxjs/operators'
4import { RestExtractor } from '@app/core'
5
6import { ActivatedRoute, Router } from '@angular/router'
7import { AccountService } from '@app/shared/shared-main/account'
8
9@Component({
10 selector: 'my-actor',
11 template: ''
12})
13export class ActorsComponent implements OnInit {
14 constructor (
15 private accountService: AccountService,
16 private route: ActivatedRoute,
17 private restExtractor: RestExtractor,
18 private router: Router
19 ) {
20 }
21
22 ngOnInit () {
23 const accountOrChannelName = this.route.snapshot.params['actorName'].replace('@', '')
24
25 this.accountService
26 .getAccount(accountOrChannelName)
27 .pipe(
28 catchError(res => {
29 if (res.status === 404 && res.message === 'Account not found') {
30 this.router.navigateByUrl(`/video-channels/${accountOrChannelName}`)
31 return empty()
32 }
33
34 return this.restExtractor.handleError(res)
35 })
36 )
37 .subscribe(() => {
38 this.router.navigateByUrl(`/accounts/${accountOrChannelName}`)
39 })
40 }
41}