|
@ -9,10 +9,12 @@ import { DataService } from '@ghostfolio/client/services/data.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; |
|
|
import { TabConfiguration, User } from '@ghostfolio/common/interfaces'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
import { hasPermission, permissions } from '@ghostfolio/common/permissions'; |
|
|
|
|
|
import { DeviceDetectorService } from 'ngx-device-detector'; |
|
|
import { Subject } from 'rxjs'; |
|
|
import { Subject } from 'rxjs'; |
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
import { takeUntil } from 'rxjs/operators'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
|
|
|
host: { class: 'page with-tabs' }, |
|
|
selector: 'gf-home-page', |
|
|
selector: 'gf-home-page', |
|
|
styleUrls: ['./home-page.scss'], |
|
|
styleUrls: ['./home-page.scss'], |
|
|
templateUrl: './home-page.html' |
|
|
templateUrl: './home-page.html' |
|
@ -22,6 +24,7 @@ export class HomePageComponent implements OnDestroy, OnInit { |
|
|
return this.hasMessage; |
|
|
return this.hasMessage; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public deviceType: string; |
|
|
public hasMessage: boolean; |
|
|
public hasMessage: boolean; |
|
|
public hasPermissionToAccessFearAndGreedIndex: boolean; |
|
|
public hasPermissionToAccessFearAndGreedIndex: boolean; |
|
|
public tabs: TabConfiguration[] = []; |
|
|
public tabs: TabConfiguration[] = []; |
|
@ -32,6 +35,7 @@ export class HomePageComponent implements OnDestroy, OnInit { |
|
|
public constructor( |
|
|
public constructor( |
|
|
private changeDetectorRef: ChangeDetectorRef, |
|
|
private changeDetectorRef: ChangeDetectorRef, |
|
|
private dataService: DataService, |
|
|
private dataService: DataService, |
|
|
|
|
|
private deviceService: DeviceDetectorService, |
|
|
private userService: UserService |
|
|
private userService: UserService |
|
|
) { |
|
|
) { |
|
|
const { globalPermissions, systemMessage } = this.dataService.fetchInfo(); |
|
|
const { globalPermissions, systemMessage } = this.dataService.fetchInfo(); |
|
@ -81,7 +85,9 @@ export class HomePageComponent implements OnDestroy, OnInit { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
public ngOnInit() { |
|
|
|
|
|
this.deviceType = this.deviceService.getDeviceInfo().deviceType; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
public ngOnDestroy() { |
|
|
this.unsubscribeSubject.next(); |
|
|
this.unsubscribeSubject.next(); |
|
|