Skip to content

Commit

Permalink
fix: update title
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey committed Feb 15, 2024
1 parent eedfcfc commit 92c27b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Component, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterLink, RouterOutlet } from '@angular/router';
import { RouterLink, RouterOutlet, TitleStrategy } from '@angular/router';
import { Auth, GoogleAuthProvider, signInWithPopup } from '@angular/fire/auth';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { environment } from '../environments/environment';
import { Title } from '@angular/platform-browser';

@Component({
selector: 'cms-root',
Expand All @@ -25,7 +26,9 @@ export class AppComponent {
isLoggedIn: boolean | undefined;
title = environment.title;
private auth: Auth = inject(Auth);
private titleService: Title = inject(Title);
constructor() {
this.titleService.setTitle(environment.title);
this.auth.onAuthStateChanged((state) => {
this.isLoggedIn = !!state?.email?.endsWith('@' + environment.emailDomain);
});
Expand Down

0 comments on commit 92c27b1

Please sign in to comment.