Commit 621496c3 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro
Browse files

(fix) "See More" will be displayed only if there is more content

parent da9dd1e5
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@
      </ng-container>
      </ng-container>
    <li
    <li
      class="m-proChannelListContentList__seeMore"
      class="m-proChannelListContentList__seeMore"
      *ngIf="entities.length != 0"
      *ngIf="entities && displaySeeMoreTile"
      [routerLink]="seeMoreRoute"
      [routerLink]="seeMoreRoute"
      i18n
      i18n
  >
  >
+8 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,8 @@ export class ProChannelListComponent implements OnInit, OnDestroy {


  period: string;
  period: string;


  displaySeeMoreTile: boolean = false;

  constructor(
  constructor(
    public feedsService: FeedsService,
    public feedsService: FeedsService,
    protected channelService: ProChannelService,
    protected channelService: ProChannelService,
@@ -75,6 +77,12 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
        if (entity)
        if (entity)
          this.entities.push(await entity.pipe(first()).toPromise());
          this.entities.push(await entity.pipe(first()).toPromise());
      }
      }

      if (this.entities.length >= 9) {
        this.displaySeeMoreTile = true;
        this.entities = this.entities.slice(0,8);
      }
      
      this.detectChanges();
      this.detectChanges();
    });
    });