From daa45ded44f0e7329a8ea88024275b0bb69ea0cb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 May 2021 14:01:18 +0200 Subject: Remove unused component --- client/src/app/root.component.ts | 44 ---------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 client/src/app/root.component.ts (limited to 'client') diff --git a/client/src/app/root.component.ts b/client/src/app/root.component.ts deleted file mode 100644 index 5a09e50d1..000000000 --- a/client/src/app/root.component.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators' -import { ActivatedRoute, Router } from '@angular/router' -import { RestExtractor } from '@app/core' -import { ActorService } from '@app/shared/shared-main/account' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' - -@Component({ - selector: 'my-root', - template: '' -}) -export class RootComponent implements OnInit { - constructor ( - private actorService: ActorService, - private route: ActivatedRoute, - private restExtractor: RestExtractor, - private router: Router - ) { - } - - ngOnInit () { - this.route.params - .pipe( - map(params => params[ 'actorName' ]), - distinctUntilChanged(), - switchMap(actorName => this.actorService.getActorType(actorName)), - catchError(err => this.restExtractor.redirectTo404IfNotFound(err, 'other', [ - HttpStatusCode.BAD_REQUEST_400, - HttpStatusCode.NOT_FOUND_404 - ])) - ) - .subscribe(actorType => { - const actorName = this.route.snapshot.params[ 'actorName' ] - - if (actorType === 'Account') { - this.router.navigate([ `/a/${actorName}` ], { state: { type: 'others', obj: { status: 200 } }, skipLocationChange: true }) - } - - if (actorType === 'VideoChannel') { - this.router.navigate([ `/c/${actorName}` ], { state: { type: 'others', obj: { status: 200 } }, skipLocationChange: true }) - } - }) - } -} -- cgit v1.2.3