import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Component, OnDestroy, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { immutableAssign } from '@app/shared/misc/utils'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { immutableAssign } from '@app/shared/misc/utils'
import { AuthService } from '../../core/auth'
import { ConfirmService } from '../../core/confirm'
import { VideoService } from '../../shared/video/video.service'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { VideoService } from '../../shared/video/video.service'
import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { Subscription } from 'rxjs'
import { ScreenService } from '@app/shared/misc/screen.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { Subscription } from 'rxjs'
import { ScreenService } from '@app/shared/misc/screen.service'
protected route: ActivatedRoute,
protected authService: AuthService,
protected notifier: Notifier,
protected confirmService: ConfirmService,
protected route: ActivatedRoute,
protected authService: AuthService,
protected notifier: Notifier,
protected confirmService: ConfirmService,
private videoChannelService: VideoChannelService,
private videoService: VideoService
) {
private videoChannelService: VideoChannelService,
private videoService: VideoService
) {
// Parent get the video channel for us
this.videoChannelSub = this.videoChannelService.videoChannelLoaded
// Parent get the video channel for us
this.videoChannelSub = this.videoChannelService.videoChannelLoaded
- .subscribe(videoChannel => {
- this.videoChannel = videoChannel
- this.currentRoute = '/video-channels/' + this.videoChannel.nameWithHost + '/videos'
+ .pipe(first())
+ .subscribe(videoChannel => {
+ this.videoChannel = videoChannel