import { Component } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { PersonalizarService } from '../../../modules/Administrador/services/personalizar.service';
import { MatDialog } from '@angular/material/dialog';




@Component({
  selector: 'app-layout-page',
  templateUrl: './layout-page.component.html',
  styleUrl: './layout-page.component.css'
})
export class LayoutPageComponent {
  public year = new Date().getFullYear();
  public name: string = '';
  public logo: string = '';

  constructor(
    private authService: AuthService,
    private _presonalizarService: PersonalizarService,
    public dialog: MatDialog,
    
  ) {
    // this.authService.logout();
    // window.location.reload();
      this._presonalizarService.getOptions().subscribe((response: any) => {
        this.name = response.personalizacion.PERNOMBRE;
        this.logo = response.personalizacion.PERLOGO;
      })
  }
  ngOnInit() {
    this.dialog.closeAll();
    sessionStorage.removeItem('token');
    localStorage.removeItem('expira');
    localStorage.removeItem('ng2Idle.main.expiry');
    localStorage.removeItem('ng2Idle.main.idling');
  }

}
