Skip to content

Commit

Permalink
Fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltruong committed Sep 24, 2024
1 parent 819be1e commit 9f15b15
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/app/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectorRef, Component, Input, OnDestroy } from '@angular/core';
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { ConfigService } from '../services/config.service';
import { SidebarService } from '../services/sidebar.service';
Expand All @@ -13,7 +13,7 @@ import { signInWithRedirect, getCurrentUser, fetchAuthSession, signOut } from 'a
templateUrl: './header.component.html',
styleUrl: './header.component.scss'
})
export class HeaderComponent implements OnDestroy {
export class HeaderComponent implements OnInit, OnDestroy {
@Input() showSideBar = true;

private subscriptions = new Subscription();
Expand Down Expand Up @@ -52,15 +52,14 @@ export class HeaderComponent implements OnDestroy {
}

// Change this to a back-end service.
const self = this;
setInterval(async () => {
self.session = await fetchAuthSession();
if (self?.session?.tokens?.idToken?.payload != null) {
self.isAuthenticed = true;
this.session = await fetchAuthSession();
if (this?.session?.tokens?.idToken?.payload != null) {
this.isAuthenticed = true;
} else {
self.isAuthenticed = false;
this.isAuthenticed = false;
}
self.changeDetectorRef.detectChanges();
this.changeDetectorRef.detectChanges();
}, 15000);
}

Expand Down

0 comments on commit 9f15b15

Please sign in to comment.