From 734a5ceb3d04088743d72babcb9b05e6142043f6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Jun 2018 11:19:26 +0200 Subject: Fix account/channel pages route subscription --- .../video-channel-videos/video-channel-videos.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src/app/+video-channels/video-channel-videos') diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts index 28c591039..2d3f66994 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts @@ -11,6 +11,7 @@ import { VideoChannelService } from '@app/shared/video-channel/video-channel.ser import { VideoChannel } from '@app/shared/video-channel/video-channel.model' import { tap } from 'rxjs/operators' import { I18n } from '@ngx-translate/i18n-polyfill' +import { Subscription } from 'rxjs' @Component({ selector: 'my-video-channel-videos', @@ -27,6 +28,7 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On loadOnInit = false private videoChannel: VideoChannel + private videoChannelSub: Subscription constructor ( protected router: Router, @@ -48,17 +50,19 @@ export class VideoChannelVideosComponent extends AbstractVideoList implements On super.ngOnInit() // Parent get the video channel for us - this.videoChannelService.videoChannelLoaded + this.videoChannelSub = this.videoChannelService.videoChannelLoaded .subscribe(videoChannel => { this.videoChannel = videoChannel this.currentRoute = '/video-channel/' + this.videoChannel.uuid + '/videos' - this.loadMoreVideos(this.pagination.currentPage) + this.reloadVideos() this.generateSyndicationList() }) } ngOnDestroy () { + if (this.videoChannelSub) this.videoChannelSub.unsubscribe() + super.ngOnDestroy() } -- cgit v1.2.3