mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-12-02 13:29:23 -06:00
Load user when auth service is ready
This commit is contained in:
parent
53d43fc914
commit
d29ae17f30
@ -1,4 +1,5 @@
|
||||
|
||||
import { switchMap } from 'rxjs/operators'
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core'
|
||||
import { ActivatedRoute, Router } from '@angular/router'
|
||||
import { AuthService, LocalStorageService, Notifier, ScopedTokensService, ScreenService, ServerService, UserService } from '@app/core'
|
||||
@ -53,7 +54,9 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
|
||||
const user = this.authService.getUser()
|
||||
let feedUrl = environment.originServerUrl
|
||||
|
||||
this.scopedTokensService.getScopedTokens().subscribe(
|
||||
this.authService.userInformationLoaded
|
||||
.pipe(switchMap(() => this.scopedTokensService.getScopedTokens()))
|
||||
.subscribe(
|
||||
tokens => {
|
||||
const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken)
|
||||
feedUrl = feedUrl + feeds.find(f => f.format === FeedFormat.RSS).url
|
||||
|
Loading…
Reference in New Issue
Block a user