AI Implementation feature(876): Authenticated Shell, Quick Tabs and Change Password 1.01 (#16)
This commit was merged in pull request #16.
This commit is contained in:
@@ -14,6 +14,7 @@ import { filter } from 'rxjs/operators';
|
||||
import { BootstrapService } from '../../core/services/bootstrap.service';
|
||||
import { AuthService } from '../../core/services/auth.service';
|
||||
import { EventStatusStore } from '../../core/services/event-status.store';
|
||||
import { AuthenticatedEventSourceService } from '../../core/services/authenticated-event-source.service';
|
||||
import { UserStore } from '../../core/services/user.store';
|
||||
import { ShellHeaderComponent } from '../shell/header/shell-header.component';
|
||||
import {
|
||||
@@ -88,6 +89,7 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||
readonly bootstrap = inject(BootstrapService);
|
||||
readonly auth = inject(AuthService);
|
||||
readonly eventStatus = inject(EventStatusStore);
|
||||
private readonly authenticatedEventSource = inject(AuthenticatedEventSourceService);
|
||||
readonly userStore = inject(UserStore);
|
||||
private readonly router = inject(Router);
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
@@ -127,12 +129,7 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||
ngOnInit(): void {
|
||||
this.userStore.hydrateFromAuth();
|
||||
void this.userStore.loadMe();
|
||||
if (typeof window !== 'undefined' && typeof (window as any).EventSource !== 'undefined') {
|
||||
const Ctor = (window as any).EventSource as new (url: string, init?: any) => any;
|
||||
this.eventStatus.start(() => {
|
||||
return new Ctor('/api/v1/events/status', { withCredentials: true }) as any;
|
||||
});
|
||||
}
|
||||
this.eventStatus.start(() => this.authenticatedEventSource.open('/api/v1/events/status'));
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
||||
Reference in New Issue
Block a user