Files
NowChess-Frontend/src/app/services/auth-dialog.service.ts
T
shosho996 ff75c8ce2f feat: NCS-63 User account implementation (#2)
User Profile info, no game before login/register, menu bar

---------

Co-authored-by: Lala, Shahd <Shahd.Lala@sybit.de>
Co-authored-by: shahdlala66 <shahd.lala66@gmail.com>
Reviewed-on: #2
2026-05-06 10:51:30 +02:00

23 lines
603 B
TypeScript

import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
export type AuthDialogState = 'login' | 'register' | null;
@Injectable({ providedIn: 'root' })
export class AuthDialogService {
private readonly dialogStateSubject = new BehaviorSubject<AuthDialogState>(null);
readonly dialogState$ = this.dialogStateSubject.asObservable();
openLogin(): void {
this.dialogStateSubject.next('login');
}
openRegister(): void {
this.dialogStateSubject.next('register');
}
close(): void {
this.dialogStateSubject.next(null);
}
}