import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { delegate } from 'utils-decorators'; import { AuthService } from '../../services/auth.service'; @Component({ selector: 'app-navbar', templateUrl: './navbar.component.html', styleUrls: ['navbar.component.scss'] }) export class NavBarComponent { constructor( private authService: AuthService, private router: Router ) { } @delegate() async gotToHomeOrLegado() { const cliente = await this.authService.getUsuario(); if (cliente) { return this.router.navigate(['/dashboard/home']); } return this.router.navigate(['/']); } }