From: Chocobozzz Date: Fri, 10 Jan 2020 10:14:57 +0000 (+0100) Subject: Fix client build X-Git-Tag: v2.1.0-rc.1~42 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=db84cf89bcb20b5aaa87f4a6d92d41cc0060a089;p=oweals%2Fpeertube.git Fix client build --- diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.html b/client/src/app/shared/user-subscription/subscribe-button.component.html index 1c2288ebb..7d33b0621 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.html +++ b/client/src/app/shared/user-subscription/subscribe-button.component.html @@ -7,12 +7,12 @@ Subscribe Subscribe to all channels - {{subscribeStatus(true).length}}/{{subscribed.size}} + {{ subscribeStatus(true).length }}/{{ subscribed.size }} channels subscribed - + {{ videoChannels[0].followersCount | myNumberFormatter }} @@ -23,7 +23,7 @@ (click)="subscribe()"> - + - + 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 1ebfdc82f..888f6552a 100644 --- a/client/src/app/shared/user-subscription/subscribe-button.component.ts +++ b/client/src/app/shared/user-subscription/subscribe-button.component.ts @@ -40,11 +40,11 @@ export class SubscribeButtonComponent implements OnInit { 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 () { @@ -65,6 +65,10 @@ export class SubscribeButtonComponent implements OnInit { return rssFeed.url } + get videoChannel () { + return this.videoChannels[0] + } + ngOnInit () { this.loadSubscribedStatus() } @@ -83,7 +87,7 @@ export class SubscribeButtonComponent implements OnInit { .filter(handle => this.subscribeStatus(false).includes(handle)) .map(handle => this.userSubscriptionService.addSubscription(handle)) - forkJoin(observableBatch) + merge(observableBatch, 2) .subscribe( () => { this.notifier.success( @@ -153,18 +157,19 @@ export class SubscribeButtonComponent implements OnInit { 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