2021-07-03 21:48:27 +00:00
|
|
|
import { Component } from '@angular/core';
|
2021-07-29 05:26:29 +00:00
|
|
|
import { Account } from '../../core/auth/account.model';
|
|
|
|
import { takeUntil } from 'rxjs/operators';
|
|
|
|
import { AccountService } from '../../core/auth/account.service';
|
|
|
|
import { Subject } from 'rxjs';
|
2021-07-03 21:48:27 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'jhi-footer',
|
|
|
|
templateUrl: './footer.component.html',
|
2021-07-24 20:36:13 +00:00
|
|
|
styleUrls: ['./footer.component.scss'],
|
2021-07-03 21:48:27 +00:00
|
|
|
})
|
2021-07-29 05:26:29 +00:00
|
|
|
export class FooterComponent {
|
|
|
|
account: Account | null = null;
|
|
|
|
notAccount: boolean = true;
|
|
|
|
private readonly destroy$ = new Subject<void>();
|
|
|
|
|
|
|
|
constructor(protected accountService: AccountService) {}
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.accountService
|
|
|
|
.getAuthenticationState()
|
|
|
|
.pipe(takeUntil(this.destroy$))
|
|
|
|
.subscribe(account => {
|
|
|
|
if (account !== null) {
|
|
|
|
this.account = account;
|
|
|
|
this.notAccount = false;
|
|
|
|
} else {
|
|
|
|
this.notAccount = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|