Fix client build
authorChocobozzz <me@florianbigard.com>
Fri, 10 Jan 2020 10:14:57 +0000 (11:14 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 10 Jan 2020 12:34:18 +0000 (13:34 +0100)
client/src/app/shared/user-subscription/subscribe-button.component.html
client/src/app/shared/user-subscription/subscribe-button.component.ts

index 1c2288ebb0e53c357ae6c26556e2d4e0f3e7c29b..7d33b06211aa14f0eb28bd32310b86efc52fb82d 100644 (file)
@@ -7,12 +7,12 @@
       <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>
@@ -23,7 +23,7 @@
             (click)="subscribe()">
       <ng-template [ngTemplateOutlet]="userLoggedOut"></ng-template>
     </button>
-  
+
     <button
       *ngIf="isAllChannelsSubscribed()" type="button"
       class="btn btn-sm" role="button"
@@ -55,7 +55,7 @@
       </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>
 
index 1ebfdc82ffad1f7a4916d711cbf371724b967a5d..888f6552a6f92d3d18af0496b868f641d0e471b4 100644 (file)
@@ -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