diff options
Diffstat (limited to 'client/src/app/shared/user-subscription/subscribe-button.component.ts')
-rw-r--r-- | client/src/app/shared/user-subscription/subscribe-button.component.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/user-subscription/subscribe-button.component.ts index e3c758942..95c2bb8f8 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/user-subscription/subscribe-button.component.ts | |||
@@ -5,6 +5,8 @@ import { UserSubscriptionService } from '@app/shared/user-subscription/user-subs | |||
5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
6 | import { NotificationsService } from 'angular2-notifications' | 6 | import { NotificationsService } from 'angular2-notifications' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | 7 | import { I18n } from '@ngx-translate/i18n-polyfill' |
8 | import { VideoService } from '@app/shared/video/video.service' | ||
9 | import { FeedFormat } from '../../../../../shared/models/feeds' | ||
8 | 10 | ||
9 | @Component({ | 11 | @Component({ |
10 | selector: 'my-subscribe-button', | 12 | selector: 'my-subscribe-button', |
@@ -23,7 +25,8 @@ export class SubscribeButtonComponent implements OnInit { | |||
23 | private router: Router, | 25 | private router: Router, |
24 | private notificationsService: NotificationsService, | 26 | private notificationsService: NotificationsService, |
25 | private userSubscriptionService: UserSubscriptionService, | 27 | private userSubscriptionService: UserSubscriptionService, |
26 | private i18n: I18n | 28 | private i18n: I18n, |
29 | private videoService: VideoService | ||
27 | ) { } | 30 | ) { } |
28 | 31 | ||
29 | get uri () { | 32 | get uri () { |
@@ -100,6 +103,10 @@ export class SubscribeButtonComponent implements OnInit { | |||
100 | } | 103 | } |
101 | 104 | ||
102 | rssOpen () { | 105 | rssOpen () { |
103 | window.open('') | 106 | const rssFeed = this.videoService |
107 | .getVideoChannelFeedUrls(this.videoChannel.id) | ||
108 | .find(i => i.format === FeedFormat.RSS) | ||
109 | |||
110 | window.open(rssFeed.url) | ||
104 | } | 111 | } |
105 | } | 112 | } |