import {Component} from '@angular/core';
import {LibraryAccountService} from './library-account.service';
// import {Router} from '@angular/router';

@Component({
  templateUrl: './account.page.html',
  styleUrls: ['./account.page.scss'],
})
export class LibraryAccountPageComponent {
  name: string;

  constructor(private readonly libraryAccountService: LibraryAccountService) {}

  async ionViewWillEnter(): Promise<void> {
    try {
      const patron = await this.libraryAccountService.getProfile();
      this.name = patron.name;
    } catch {
      // this.router.navigate(['profile']);
    }
  }
}
