diff --git a/src/app/player/components/video-player/sidebar/sidebar.component.ts b/src/app/player/components/video-player/sidebar/sidebar.component.ts index e56e4aef5..edac9557f 100644 --- a/src/app/player/components/video-player/sidebar/sidebar.component.ts +++ b/src/app/player/components/video-player/sidebar/sidebar.component.ts @@ -3,6 +3,7 @@ import { Router } from '@angular/router'; import { Store } from '@ngrx/store'; import { Channel } from '../../../../../../shared/channel.interface'; import { DataService } from '../../../../services/data.service'; +import * as PlaylistActions from '../../../../state/actions'; import { selectPlaylistTitle } from '../../../../state/selectors'; import { SidebarView } from '../video-player.component'; @@ -28,6 +29,7 @@ export class SidebarComponent { goBack(): void { if (this.sidebarView === 'PLAYLISTS') { + this.store.dispatch(PlaylistActions.resetActiveChannel()); this.router.navigate(['/']); } else { this.sidebarView = 'PLAYLISTS'; diff --git a/src/app/state/actions.ts b/src/app/state/actions.ts index c6887a04e..dd5a62a10 100644 --- a/src/app/state/actions.ts +++ b/src/app/state/actions.ts @@ -71,6 +71,10 @@ export const setActiveChannel = createAction( props<{ channel: Channel }>() ); +export const resetActiveChannel = createAction( + `${STORE_KEY} Reset active channel` +); + export const setActiveChannelSuccess = createAction( `${STORE_KEY} Set active channel success`, props<{ channel: Channel }>() diff --git a/src/app/state/reducers.ts b/src/app/state/reducers.ts index 2f7bd3898..a8298d604 100644 --- a/src/app/state/reducers.ts +++ b/src/app/state/reducers.ts @@ -33,6 +33,12 @@ export const playlistReducer = createReducer( }; } ), + on(PlaylistActions.resetActiveChannel, (state): PlaylistState => { + return { + ...state, + active: undefined, + }; + }), on( PlaylistActions.setCurrentEpgProgram, (state, action): PlaylistState => ({