|
|
@ -1,5 +1,7 @@ |
|
|
|
import { Component, OnDestroy } from '@angular/core'; |
|
|
|
import { Subject } from 'rxjs'; |
|
|
|
import { ChangeDetectorRef, Component, OnDestroy } from '@angular/core'; |
|
|
|
import { UserService } from '@ghostfolio/client/services/user/user.service'; |
|
|
|
import { User } from '@ghostfolio/common/interfaces'; |
|
|
|
import { Subject, takeUntil } from 'rxjs'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
host: { class: 'page' }, |
|
|
@ -8,9 +10,26 @@ import { Subject } from 'rxjs'; |
|
|
|
templateUrl: './faq-page.html' |
|
|
|
}) |
|
|
|
export class FaqPageComponent implements OnDestroy { |
|
|
|
public user: User; |
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>(); |
|
|
|
|
|
|
|
public constructor() {} |
|
|
|
public constructor( |
|
|
|
private changeDetectorRef: ChangeDetectorRef, |
|
|
|
private userService: UserService |
|
|
|
) {} |
|
|
|
|
|
|
|
public ngOnInit() { |
|
|
|
this.userService.stateChanged |
|
|
|
.pipe(takeUntil(this.unsubscribeSubject)) |
|
|
|
.subscribe((state) => { |
|
|
|
if (state?.user) { |
|
|
|
this.user = state.user; |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
this.unsubscribeSubject.next(); |
|
|
|