ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix changing channel/account
Chocobozzz0f7224b0d126
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.html b/client/src/app/+accounts/account-videos/account-videos.component.htmlindex f88d141c24..6b9e2bb9f5 100644--- a/client/src/app/+accounts/account-videos/account-videos.component.html+++ b/client/src/app/+accounts/account-videos/account-videos.component.html@@ -1,4 +1,6 @@<my-videos-list+ #videosList+*ngIf="account"[title]="title"diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.tsindex a464cc1684..02478de241 100644--- a/client/src/app/+accounts/account-videos/account-videos.component.ts+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts@@ -1,14 +1,13 @@-import { Subscription } from 'rxjs'-import { first } from 'rxjs/operators'-import { Component, OnDestroy, OnInit } from '@angular/core'-import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core'-import { VideoSortField } from '@peertube/peertube-models'-import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component'import { NgIf } from '@angular/common'+import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'+import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core'+import { Account } from '@app/shared/shared-main/account/account.model'import { AccountService } from '@app/shared/shared-main/account/account.service'import { VideoService } from '@app/shared/shared-main/video/video.service'-import { Account } from '@app/shared/shared-main/account/account.model'import { VideoFilters } from '@app/shared/shared-video-miniature/video-filters.model'+import { VideoSortField } from '@peertube/peertube-models'+import { Subscription } from 'rxjs'+import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component'@Component({selector: 'my-account-videos',@@ -17,6 +16,8 @@ import { VideoFilters } from '@app/shared/shared-video-miniature/video-filters.mimports: [ NgIf, VideosListComponent ]})export class AccountVideosComponent implements OnInit, OnDestroy, DisableForReuseHook {+ @ViewChild('videosList') videosList: VideosListComponent+getVideosObservableFunction = this.getVideosObservable.bind(this)getSyndicationItemsFunction = this.getSyndicationItems.bind(this)@@ -26,6 +27,8 @@ export class AccountVideosComponent implements OnInit, OnDestroy, DisableForReusaccount: Accountdisabled = false+ private alreadyLoaded = false+private accountSub: Subscriptionconstructor (@@ -37,8 +40,13 @@ export class AccountVideosComponent implements OnInit, OnDestroy, DisableForReusngOnInit () {// Parent get the account for us- this.accountService.accountLoaded.pipe(first())- .subscribe(account => this.account = account)+ this.accountSub = this.accountService.accountLoaded+ .subscribe(account => {+ this.account = account+ if (this.alreadyLoaded) this.videosList.reloadVideos()++ this.alreadyLoaded = true+ })}ngOnDestroy () {diff --git a/client/src/app/+accounts/accounts.component.html b/client/src/app/+accounts/accounts.component.htmlindex ac11705a5a..80c805836f 100644--- a/client/src/app/+accounts/accounts.component.html+++ b/client/src/app/+accounts/accounts.component.html@@ -7,6 +7,8 @@<div><div class="section-label" i18n>ACCOUNT</div>+ <a routerLink="/a/jean">Coucou</a>+<div class="actor-info"><div><div class="actor-display-name align-items-center">diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.tsindex ce373e3311..3afc16a914 100644--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts@@ -45,6 +45,8 @@ export class VideoChannelPlaylistsComponent implements OnInit, AfterViewInit, Onthis.hooks.runAction('action:video-channel-playlists.video-channel.loaded', 'video-channel', { videoChannel })+ this.videoPlaylists = []+ this.pagination.currentPage = 1this.loadVideoPlaylists()})}diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.htmlindex 9e9e98c99b..b70f5569a5 100644--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.html@@ -1,4 +1,6 @@<my-videos-list+ #videosList+*ngIf="videoChannel"[title]="title"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.tsindex 923bc9d4fd..d1ca834c22 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@@ -1,15 +1,14 @@-import { Subscription } from 'rxjs'-import { first } from 'rxjs/operators'-import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core'-import { ComponentPaginationLight, DisableForReuseHook, HooksService, ScreenService } from '@app/core'-import { Video, VideoSortField } from '@peertube/peertube-models'-import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component'import { NgIf } from '@angular/common'+import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild, viewChild } from '@angular/core'+import { ComponentPaginationLight, DisableForReuseHook, HooksService, ScreenService } from '@app/core'import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'import { VideoChannelService } from '@app/shared/shared-main/video-channel/video-channel.service'import { VideoService } from '@app/shared/shared-main/video/video.service'-import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature/video-miniature.component'import { VideoFilters } from '@app/shared/shared-video-miniature/video-filters.model'+import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature/video-miniature.component'+import { Video, VideoSortField } from '@peertube/peertube-models'+import { Subscription } from 'rxjs'+import { VideosListComponent } from '../../shared/shared-video-miniature/videos-list.component'@Component({selector: 'my-video-channel-videos',@@ -18,6 +17,8 @@ import { VideoFilters } from '@app/shared/shared-video-miniature/video-filters.mimports: [ NgIf, VideosListComponent ]})export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDestroy, DisableForReuseHook {+ @ViewChild('videosList') videosList: VideosListComponent+getVideosObservableFunction = this.getVideosObservable.bind(this)getSyndicationItemsFunction = this.getSyndicationItems.bind(this)@@ -39,6 +40,7 @@ export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDesdisabled = falseprivate videoChannelSub: Subscription+ private alreadyLoaded = falseconstructor (private screenService: ScreenService,@@ -50,11 +52,14 @@ export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDesngOnInit () {// Parent get the video channel for us- this.videoChannelService.videoChannelLoaded.pipe(first())+ this.videoChannelSub = this.videoChannelService.videoChannelLoaded.subscribe(videoChannel => {this.videoChannel = videoChannel+ if (this.alreadyLoaded) this.videosList.reloadVideos()this.hooks.runAction('action:video-channel-videos.video-channel.loaded', 'video-channel', { videoChannel })++ this.alreadyLoaded = true})}