From a5046e6bf22308ae516ef6d7abb5ae8709e925db Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Tue, 18 Mar 2025 01:10:56 -0400 Subject: added log out button. -ak --- ufund-ui/src/app/app.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ufund-ui/src/app/app.component.ts') diff --git a/ufund-ui/src/app/app.component.ts b/ufund-ui/src/app/app.component.ts index 6f4e1f5..7dc8ffb 100644 --- a/ufund-ui/src/app/app.component.ts +++ b/ufund-ui/src/app/app.component.ts @@ -1,6 +1,7 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnInit, Inject} from '@angular/core'; import {UsersService} from './services/users.service'; import {BehaviorSubject} from 'rxjs'; +import { DOCUMENT } from '@angular/common'; @Component({ selector: 'app-root', @@ -13,9 +14,14 @@ export class AppComponent implements OnInit { currentUser$: BehaviorSubject = new BehaviorSubject("Logged out."); constructor( - private userService: UsersService + private userService: UsersService, + @Inject(DOCUMENT) private document: Document ) {} + reloadPage() { + this.document.defaultView?.location.reload(); + } + ngOnInit() { this.userService.getCurrentUserSubject().subscribe(r => { this.currentUser$?.next(r -- cgit v1.2.3