diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-11-09 16:25:27 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-25 11:07:56 +0100 |
commit | 5beb89f223539f1e415a976ff104f772526b4d20 (patch) | |
tree | 2164677d16a2965d63499e249aa75ab0e06e3a6c /client/src/app/+videos | |
parent | afff310e50f2fa8419bb4242470cbde46ab54463 (diff) | |
download | PeerTube-5beb89f223539f1e415a976ff104f772526b4d20.tar.gz PeerTube-5beb89f223539f1e415a976ff104f772526b4d20.tar.zst PeerTube-5beb89f223539f1e415a976ff104f772526b4d20.zip |
refactor scoped token service
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/video-list/video-user-subscriptions.component.ts | 22 |
1 files changed, 17 insertions, 5 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 10031d6cc..03881c295 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,6 +1,6 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core' | 3 | import { AuthService, LocalStorageService, Notifier, ScopedTokensService, ScreenService, ServerService, UserService } from '@app/core' |
4 | import { HooksService } from '@app/core/plugins/hooks.service' | 4 | import { HooksService } from '@app/core/plugins/hooks.service' |
5 | import { immutableAssign } from '@app/helpers' | 5 | import { immutableAssign } from '@app/helpers' |
6 | import { VideoService } from '@app/shared/shared-main' | 6 | import { VideoService } from '@app/shared/shared-main' |
@@ -9,6 +9,7 @@ import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-mi | |||
9 | import { VideoSortField, FeedFormat } from '@shared/models' | 9 | import { VideoSortField, FeedFormat } from '@shared/models' |
10 | import { copyToClipboard } from '../../../root-helpers/utils' | 10 | import { copyToClipboard } from '../../../root-helpers/utils' |
11 | import { environment } from '../../../environments/environment' | 11 | import { environment } from '../../../environments/environment' |
12 | import { forkJoin } from 'rxjs' | ||
12 | 13 | ||
13 | @Component({ | 14 | @Component({ |
14 | selector: 'my-videos-user-subscriptions', | 15 | selector: 'my-videos-user-subscriptions', |
@@ -32,7 +33,8 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement | |||
32 | protected storageService: LocalStorageService, | 33 | protected storageService: LocalStorageService, |
33 | private userSubscription: UserSubscriptionService, | 34 | private userSubscription: UserSubscriptionService, |
34 | private hooks: HooksService, | 35 | private hooks: HooksService, |
35 | private videoService: VideoService | 36 | private videoService: VideoService, |
37 | private scopedTokensService: ScopedTokensService | ||
36 | ) { | 38 | ) { |
37 | super() | 39 | super() |
38 | 40 | ||
@@ -49,9 +51,19 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement | |||
49 | super.ngOnInit() | 51 | super.ngOnInit() |
50 | 52 | ||
51 | const user = this.authService.getUser() | 53 | const user = this.authService.getUser() |
52 | let feedUrl = environment.embedUrl | 54 | let feedUrl = environment.originServerUrl |
53 | this.videoService.getVideoSubscriptionFeedUrls(user.account.id) | 55 | |
54 | .then((feeds: any) => feedUrl = feedUrl + feeds.find((f: any) => f.format === FeedFormat.RSS).url) | 56 | this.scopedTokensService.getScopedTokens().subscribe( |
57 | tokens => { | ||
58 | const feeds = this.videoService.getVideoSubscriptionFeedUrls(user.account.id, tokens.feedToken) | ||
59 | feedUrl = feedUrl + feeds.find((f: any) => f.format === FeedFormat.RSS).url | ||
60 | }, | ||
61 | |||
62 | err => { | ||
63 | this.notifier.error(err.message) | ||
64 | } | ||
65 | ) | ||
66 | |||
55 | this.actions.unshift({ | 67 | this.actions.unshift({ |
56 | label: $localize`Feed`, | 68 | label: $localize`Feed`, |
57 | iconName: 'syndication', | 69 | iconName: 'syndication', |