|
|
@ -9,12 +9,7 @@ import { |
|
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
|
|
|
|
|
import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; |
|
|
|
import { |
|
|
|
MatSnackBar, |
|
|
|
MatSnackBarRef, |
|
|
|
TextOnlySnackBar |
|
|
|
} from '@angular/material/snack-bar'; |
|
|
|
import { Router } from '@angular/router'; |
|
|
|
import { MatSnackBarRef, TextOnlySnackBar } from '@angular/material/snack-bar'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
|
|
|
|
@ -39,8 +34,6 @@ export class HomeSummaryComponent implements OnDestroy, OnInit { |
|
|
|
private changeDetectorRef: ChangeDetectorRef, |
|
|
|
private dataService: DataService, |
|
|
|
private impersonationStorageService: ImpersonationStorageService, |
|
|
|
private router: Router, |
|
|
|
private snackBar: MatSnackBar, |
|
|
|
private userService: UserService |
|
|
|
) { |
|
|
|
this.info = this.dataService.fetchInfo(); |
|
|
@ -108,24 +101,6 @@ export class HomeSummaryComponent implements OnDestroy, OnInit { |
|
|
|
this.summary = summary; |
|
|
|
this.isLoading = false; |
|
|
|
|
|
|
|
if (!this.summary) { |
|
|
|
this.snackBarRef = this.snackBar.open( |
|
|
|
$localize`This feature requires a subscription.`, |
|
|
|
this.hasPermissionForSubscription |
|
|
|
? $localize`Upgrade Plan` |
|
|
|
: undefined, |
|
|
|
{ duration: 6000 } |
|
|
|
); |
|
|
|
|
|
|
|
this.snackBarRef.afterDismissed().subscribe(() => { |
|
|
|
this.snackBarRef = undefined; |
|
|
|
}); |
|
|
|
|
|
|
|
this.snackBarRef.onAction().subscribe(() => { |
|
|
|
this.router.navigate(['/' + $localize`pricing`]); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
}); |
|
|
|
|
|
|
|