From fe96eac8aea3ba2e54de0ca4f149d31ba05ef9be Mon Sep 17 00:00:00 2001 From: 4gray <4gray@users.noreply.github.com> Date: Fri, 24 Feb 2023 12:49:32 +0100 Subject: [PATCH] refactor: remove unused method --- src/app/home/home.component.spec.ts | 10 ---------- src/app/home/home.component.ts | 11 ----------- 2 files changed, 21 deletions(-) diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index 99a4fbbab..66a5f83b0 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -132,16 +132,6 @@ describe('HomeComponent', () => { expect(component.showNotification).toHaveBeenCalledTimes(1); }); - it('should navigate to the player view', () => { - jest.spyOn(router, 'navigateByUrl'); - const playlistId = 'some-id'; - component.navigateToPlayer(playlistId); - expect(router.navigateByUrl).toHaveBeenCalledTimes(1); - expect(router.navigateByUrl).toHaveBeenCalledWith( - `/playlists/${playlistId}` - ); - }); - it('should remove all ipc listeners on destroy', () => { jest.spyOn(electronService, 'removeAllListeners'); component.ngOnDestroy(); diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 1936556eb..68b10018e 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,6 +1,5 @@ import { Component, NgZone } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; -import { Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { TranslateService } from '@ngx-translate/core'; import { @@ -32,7 +31,6 @@ export class HomeComponent { playlist: response.payload, }) ); - this.navigateToPlayer(response.payload._id); }, }, { @@ -46,7 +44,6 @@ export class HomeComponent { constructor( private dataService: DataService, private ngZone: NgZone, - private router: Router, private snackBar: MatSnackBar, private readonly store: Store, private translateService: TranslateService @@ -107,14 +104,6 @@ export class HomeComponent { ); } - /** - * Navigates to the video player route - */ - navigateToPlayer(playlistId: string): void { - this.isLoading = false; - this.router.navigateByUrl(`/playlists/${playlistId}`); - } - /** * Sends url of the playlist to the renderer process * @param playlistUrl url of the added playlist