aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-15 09:51:26 +0100
committerChocobozzz <me@florianbigard.com>2021-01-15 10:23:40 +0100
commitd29ae17f3058006e4c88399800d30ee73a60ba5f (patch)
tree14815696ae0201c49e1c94285ef88fb77817af14
parent53d43fc9147059f3d265140e025a6ebd802481dc (diff)
downloadPeerTube-d29ae17f3058006e4c88399800d30ee73a60ba5f.tar.gz
PeerTube-d29ae17f3058006e4c88399800d30ee73a60ba5f.tar.zst
PeerTube-d29ae17f3058006e4c88399800d30ee73a60ba5f.zip
Load user when auth service is ready
-rw-r--r--client/src/app/+videos/video-list/video-user-subscriptions.component.ts21
1 files changed, 12 insertions, 9 deletions
diff --git a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
index bd0337c1d..6d19707df 100644
--- a/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
+++ b/client/src/app/+videos/video-list/video-user-subscriptions.component.ts
@@ -1,4 +1,5 @@
1 1
2import { switchMap } from 'rxjs/operators'
2import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, LocalStorageService, Notifier, ScopedTokensService, ScreenService, ServerService, UserService } from '@app/core' 5import { AuthService, LocalStorageService, Notifier, ScopedTokensService, ScreenService, ServerService, UserService } from '@app/core'
@@ -53,16 +54,18 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
53 const user = this.authService.getUser() 54 const user = this.authService.getUser()
54 let feedUrl = environment.originServerUrl 55 let feedUrl = environment.originServerUrl
55 56
56 this.scopedTokensService.getScopedTokens().subscribe( 57 this.authService.userInformationLoaded
57 tokens => { 58 .pipe(switchMap(() => this.scopedTokensService.getScopedTokens()))
58 const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken) 59 .subscribe(
59 feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url 60 tokens => {
60 }, 61 const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken)
62 feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url
63 },
61 64
62 err => { 65 err => {
63 this.notifier.error(err.message) 66 this.notifier.error(err.message)
64 } 67 }
65 ) 68 )
66 69
67 this.actions.unshift({ 70 this.actions.unshift({
68 label: $localize`Feed`, 71 label: $localize`Feed`,