...
 
Commits (2)
......@@ -7,7 +7,7 @@ import {
OnInit,
} from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Subscription } from 'rxjs';
import { BehaviorSubject, Subscription } from 'rxjs';
import { FeedsService } from '../../../../common/services/feeds.service';
import {
NavItems,
......@@ -17,6 +17,7 @@ import {
import { OverlayModalService } from '../../../../services/ux/overlay-modal';
import { MindsTitle } from '../../../../services/ux/title';
import { filter } from 'rxjs/operators';
import { map } from 'rxjs/operators';
@Component({
selector: 'm-pro--channel-list',
......@@ -41,6 +42,8 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
selectedHashtag: string = 'all';
entities$;
constructor(
public feedsService: FeedsService,
protected modalService: OverlayModalService,
......@@ -50,7 +53,20 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
protected router: Router,
protected cd: ChangeDetectorRef,
protected injector: Injector
) {}
) {
this.entities$ = this.feedsService.feed.pipe(
map((elements: BehaviorSubject<any>[]) => {
return elements.filter((element: BehaviorSubject<any>) => {
const entity = element.getValue();
return (
!!entity.thumbnail_src ||
!!entity.custom_data ||
(entity.thumbnails && entity.thumbnails.length > 0)
);
});
})
);
}
ngOnInit() {
this.params$ = this.route.params.subscribe(params => {
......@@ -166,12 +182,6 @@ export class ProChannelListComponent implements OnInit, OnDestroy {
this.channelService.pushMenuNavItems(navItems, true);
}
get entities$() {
return this.feedsService.feed.pipe(
filter((entity: any) => !!entity.thumbnail_src)
);
}
get hasMore$() {
return this.feedsService.hasMore;
}
......
......@@ -41,14 +41,21 @@
</div>
<div>
<button
class="mf-button mf-button--alt"
[disabled]="inProgress || criticalError"
(click)="enable()"
i18n
>
Upgrade to Pro
</button>
<ng-container *mIfFeature="'purchase-pro'; else comingSoon">
<button
class="mf-button mf-button--alt"
[disabled]="inProgress || criticalError"
(click)="enable()"
i18n
>
Upgrade to Pro
</button>
</ng-container>
<ng-template #comingSoon>
<button class="mf-button mf-button--alt" i18n>
Coming soon
</button>
</ng-template>
</div>
</div>
......
......@@ -127,14 +127,24 @@
</div>
<div class="m-upgradesUpgradeOptionsPlan__row">
<a
class="mf-button m-upgradesUpgradeOptionsPlan__action"
routerLink="/pro"
[queryParams]="intervalCurrencyQueryParams"
*ngIf="!session.getLoggedInUser()?.pro"
>
Upgrade to Pro
</a>
<ng-container *mIfFeature="'purchase-pro'; else comingSoon">
<a
class="mf-button m-upgradesUpgradeOptionsPlan__action"
routerLink="/pro"
[queryParams]="intervalCurrencyQueryParams"
*ngIf="!session.getLoggedInUser()?.pro"
>
Upgrade to Pro
</a>
</ng-container>
<ng-template #comingSoon>
<a
class="mf-button m-upgradesUpgradeOptionsPlan__action"
routerLink="/pro"
>
Coming soon
</a>
</ng-template>
</div>
<div
......