|
|
@ -10,6 +10,7 @@ import { UserService } from '@ghostfolio/client/services/user/user.service';
|
|
|
|
import { PortfolioPerformance, User } from '@ghostfolio/common/interfaces';
|
|
|
|
import { PortfolioPerformance, User } from '@ghostfolio/common/interfaces';
|
|
|
|
import { DateRange } from '@ghostfolio/common/types';
|
|
|
|
import { DateRange } from '@ghostfolio/common/types';
|
|
|
|
import { LineChartItem } from '@ghostfolio/ui/line-chart/interfaces/line-chart.interface';
|
|
|
|
import { LineChartItem } from '@ghostfolio/ui/line-chart/interfaces/line-chart.interface';
|
|
|
|
|
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { Subject } from 'rxjs';
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
|
|
|
|
|
|
|
@ -27,6 +28,7 @@ export class HomeOverviewComponent implements OnDestroy, OnInit {
|
|
|
|
{ label: '5Y', value: '5y' },
|
|
|
|
{ label: '5Y', value: '5y' },
|
|
|
|
{ label: 'Max', value: 'max' }
|
|
|
|
{ label: 'Max', value: 'max' }
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
public deviceType: string;
|
|
|
|
public hasImpersonationId: boolean;
|
|
|
|
public hasImpersonationId: boolean;
|
|
|
|
public historicalDataItems: LineChartItem[];
|
|
|
|
public historicalDataItems: LineChartItem[];
|
|
|
|
public isAllTimeHigh: boolean;
|
|
|
|
public isAllTimeHigh: boolean;
|
|
|
@ -43,6 +45,7 @@ export class HomeOverviewComponent implements OnDestroy, OnInit {
|
|
|
|
public constructor(
|
|
|
|
public constructor(
|
|
|
|
private changeDetectorRef: ChangeDetectorRef,
|
|
|
|
private changeDetectorRef: ChangeDetectorRef,
|
|
|
|
private dataService: DataService,
|
|
|
|
private dataService: DataService,
|
|
|
|
|
|
|
|
private deviceService: DeviceDetectorService,
|
|
|
|
private impersonationStorageService: ImpersonationStorageService,
|
|
|
|
private impersonationStorageService: ImpersonationStorageService,
|
|
|
|
private settingsStorageService: SettingsStorageService,
|
|
|
|
private settingsStorageService: SettingsStorageService,
|
|
|
|
private userService: UserService
|
|
|
|
private userService: UserService
|
|
|
@ -62,6 +65,8 @@ export class HomeOverviewComponent implements OnDestroy, OnInit {
|
|
|
|
* Initializes the controller
|
|
|
|
* Initializes the controller
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public ngOnInit() {
|
|
|
|
public ngOnInit() {
|
|
|
|
|
|
|
|
this.deviceType = this.deviceService.getDeviceInfo().deviceType;
|
|
|
|
|
|
|
|
|
|
|
|
this.impersonationStorageService
|
|
|
|
this.impersonationStorageService
|
|
|
|
.onChangeHasImpersonation()
|
|
|
|
.onChangeHasImpersonation()
|
|
|
|
.pipe(takeUntil(this.unsubscribeSubject))
|
|
|
|
.pipe(takeUntil(this.unsubscribeSubject))
|
|
|
|