aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+accounts/account-videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-07 11:19:26 +0200
committerChocobozzz <me@florianbigard.com>2018-06-07 11:19:26 +0200
commit734a5ceb3d04088743d72babcb9b05e6142043f6 (patch)
tree965bfbd0bf930cf4cc9568a5dc801c4e3909a1b4 /client/src/app/+accounts/account-videos
parentcc69c8db39f48b1053c246458541ccc406228711 (diff)
downloadPeerTube-734a5ceb3d04088743d72babcb9b05e6142043f6.tar.gz
PeerTube-734a5ceb3d04088743d72babcb9b05e6142043f6.tar.zst
PeerTube-734a5ceb3d04088743d72babcb9b05e6142043f6.zip
Fix account/channel pages route subscription
Diffstat (limited to 'client/src/app/+accounts/account-videos')
-rw-r--r--client/src/app/+accounts/account-videos/account-videos.component.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts
index 476f04024..5e3dbb6b3 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.ts
+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts
@@ -11,6 +11,7 @@ import { Account } from '@app/shared/account/account.model'
11import { AccountService } from '@app/shared/account/account.service' 11import { AccountService } from '@app/shared/account/account.service'
12import { tap } from 'rxjs/operators' 12import { tap } from 'rxjs/operators'
13import { I18n } from '@ngx-translate/i18n-polyfill' 13import { I18n } from '@ngx-translate/i18n-polyfill'
14import { Subscription } from 'rxjs'
14 15
15@Component({ 16@Component({
16 selector: 'my-account-videos', 17 selector: 'my-account-videos',
@@ -27,6 +28,7 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
27 loadOnInit = false 28 loadOnInit = false
28 29
29 private account: Account 30 private account: Account
31 private accountSub: Subscription
30 32
31 constructor ( 33 constructor (
32 protected router: Router, 34 protected router: Router,
@@ -48,17 +50,19 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit,
48 super.ngOnInit() 50 super.ngOnInit()
49 51
50 // Parent get the account for us 52 // Parent get the account for us
51 this.accountService.accountLoaded 53 this.accountSub = this.accountService.accountLoaded
52 .subscribe(account => { 54 .subscribe(account => {
53 this.account = account 55 this.account = account
54 this.currentRoute = '/account/' + this.account.id + '/videos' 56 this.currentRoute = '/account/' + this.account.nameWithHost + '/videos'
55 57
56 this.loadMoreVideos(this.pagination.currentPage) 58 this.reloadVideos()
57 this.generateSyndicationList() 59 this.generateSyndicationList()
58 }) 60 })
59 } 61 }
60 62
61 ngOnDestroy () { 63 ngOnDestroy () {
64 if (this.accountSub) this.accountSub.unsubscribe()
65
62 super.ngOnDestroy() 66 super.ngOnDestroy()
63 } 67 }
64 68