ff75c8ce2f
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
23 lines
603 B
TypeScript
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);
|
|
}
|
|
} |