From e83e86d6a37cb440f570fd104001ed1d5a5125e0 Mon Sep 17 00:00:00 2001 From: Daniel von Atzigen Date: Wed, 27 Nov 2024 17:16:38 +0100 Subject: [PATCH 1/2] Fix app version not being displayed --- .../src/app/components/app-bar/app-bar.component.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/client-asset-sg/src/app/components/app-bar/app-bar.component.ts b/apps/client-asset-sg/src/app/components/app-bar/app-bar.component.ts index 43901fda..fd3de5c7 100644 --- a/apps/client-asset-sg/src/app/components/app-bar/app-bar.component.ts +++ b/apps/client-asset-sg/src/app/components/app-bar/app-bar.component.ts @@ -1,15 +1,6 @@ import { ENTER } from '@angular/cdk/keycodes'; import { HttpClient } from '@angular/common/http'; -import { - ChangeDetectionStrategy, - Component, - ElementRef, - inject, - Input, - OnInit, - Output, - ViewChild, -} from '@angular/core'; +import { Component, ElementRef, inject, Input, OnInit, Output, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { appSharedStateActions, AuthService, fromAppShared } from '@asset-sg/client-shared'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; @@ -24,7 +15,6 @@ import { Version } from './version'; selector: 'asset-sg-app-bar', templateUrl: './app-bar.component.html', styleUrls: ['./app-bar.component.scss'], - changeDetection: ChangeDetectionStrategy.OnPush, }) export class AppBarComponent implements OnInit { // TODO use new pattern here From b8d85237a8dcff24055fb55e8ca0bb0b1e13b794 Mon Sep 17 00:00:00 2001 From: Daniel von Atzigen Date: Wed, 27 Nov 2024 17:33:05 +0100 Subject: [PATCH 2/2] Fix disclaimer not appearing in anonymous mode --- .../src/lib/features/auth/auth.service.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/libs/client-shared/src/lib/features/auth/auth.service.ts b/libs/client-shared/src/lib/features/auth/auth.service.ts index e1da50f7..df010811 100644 --- a/libs/client-shared/src/lib/features/auth/auth.service.ts +++ b/libs/client-shared/src/lib/features/auth/auth.service.ts @@ -27,7 +27,8 @@ export class AuthService { private readonly _isInitialized$ = new BehaviorSubject(false); async initialize(oAuthConfig: Record) { - if (oAuthConfig['anonymous_mode']) { + const isAnonymous = oAuthConfig['anonymous_mode']; + if (isAnonymous) { this.setState(AuthState.Success); this.store.dispatch(appSharedStateActions.setAnonymousMode()); } else { @@ -50,6 +51,14 @@ export class AuthService { this.store.dispatch(appSharedStateActions.loadUserProfile()); } this._isInitialized$.next(true); + + const isLoggedIn = isAnonymous || this._state$.value === AuthState.Success; + if (isLoggedIn && !this.configService.getHideDisclaimer()) { + this.dialogService.open(DisclaimerDialogComponent, { + width: '500px', + disableClose: true, + }); + } } async signIn(): Promise { @@ -62,13 +71,6 @@ export class AuthService { // If something else has interrupted the auth process, then we don't want to signal a success. if (this._state$.value === AuthState.Ongoing) { this._state$.next(AuthState.Success); - - if (!this.configService.getHideDisclaimer()) { - this.dialogService.open(DisclaimerDialogComponent, { - width: '500px', - disableClose: true, - }); - } } } } else {