<ng-template i18n #single>Subscribe</ng-template>
<ng-template #multiple>
<span i18n>Subscribe to all channels</span>
- <span *ngIf="isAtLeastOneChannelSubscribed()">{{subscribeStatus(true).length}}/{{subscribed.size}}
+ <span *ngIf="isAtLeastOneChannelSubscribed()">{{ subscribeStatus(true).length }}/{{ subscribed.size }}
<ng-container i18n>channels subscribed</ng-container>
</span>
</ng-template>
</span>
- <span *ngIf="!isBigButton() && displayFollowers && videoChannels.length > 1 && videoChannels[0].followersCount !== 0" class="followers-count">
+ <span *ngIf="!isBigButton() && displayFollowers && videoChannels.length > 1 && videoChannel.followersCount !== 0" class="followers-count">
{{ videoChannels[0].followersCount | myNumberFormatter }}
</span>
</ng-template>
(click)="subscribe()">
<ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template>
</button>
-
+
<button
*ngIf="isAllChannelsSubscribed()" type="button"
class="btn btn-sm" role="button"
</button>
<button class="dropdown-item" i18n>Subscribe with a Mastodon account:</button>
- <my-remote-subscribe showHelp="true" [uri]="channelUri"></my-remote-subscribe>
+ <my-remote-subscribe showHelp="true" [uri]="uri"></my-remote-subscribe>
<div class="dropdown-divider"></div>
get handle () {
return this.account
? this.account.nameWithHost
- : this.videoChannels[0].name + '@' + this.videoChannels[0].host
+ : this.videoChannel.name + '@' + this.videoChannel.host
}
get channelHandle () {
- return this.getChannelHandler(this.videoChannels[0])
+ return this.getChannelHandler(this.videoChannel)
}
get uri () {
return rssFeed.url
}
+ get videoChannel () {
+ return this.videoChannels[0]
+ }
+
ngOnInit () {
this.loadSubscribedStatus()
}
.filter(handle => this.subscribeStatus(false).includes(handle))
.map(handle => this.userSubscriptionService.addSubscription(handle))
- forkJoin(observableBatch)
+ merge(observableBatch, 2)
.subscribe(
() => {
this.notifier.success(
this.router.navigate([ '/login' ])
}
- private getChannelHandler (videoChannel: VideoChannel) {
- return videoChannel.name + '@' + videoChannel.host
- }
-
- private subscribeStatus (subscribed: boolean) {
+ subscribeStatus (subscribed: boolean) {
const accumulator: string[] = []
for (const [key, value] of this.subscribed.entries()) {
if (value === subscribed) accumulator.push(key)
}
+
return accumulator
}
+ private getChannelHandler (videoChannel: VideoChannel) {
+ return videoChannel.name + '@' + videoChannel.host
+ }
+
private loadSubscribedStatus () {
if (!this.isUserLoggedIn()) return