@@ -11,7 +11,6 @@ import {
1111 MatSidenav ,
1212 MatSidenavContent ,
1313} from '@angular/material/sidenav' ;
14- import { map } from 'rxjs' ;
1514import { TranslateModule , TranslateService } from '@ngx-translate/core' ;
1615import { MatIconButton } from '@angular/material/button' ;
1716import { MatIcon } from '@angular/material/icon' ;
@@ -22,7 +21,7 @@ import {
2221 MatListItemIcon ,
2322} from '@angular/material/list' ;
2423import { Store } from '@ngrx/store' ;
25- import { selectAuthTokenResponse } from './entities/auth/state/auth.selectors' ;
24+ import { selectAuthIsAuthorized } from './entities/auth/state/auth.selectors' ;
2625import { AuthActions } from './entities/auth/state/auth.actions' ;
2726import { selectAppIsOffline } from './state/app.selectors' ;
2827import { MatProgressSpinner } from '@angular/material/progress-spinner' ;
@@ -62,9 +61,9 @@ export class AppComponent {
6261 private readonly store = inject ( Store ) ;
6362 private readonly translateService = inject ( TranslateService ) ;
6463
65- public readonly isOffline = toSignal ( this . store . select ( selectAppIsOffline ) ) ;
64+ public readonly isOffline = this . store . selectSignal ( selectAppIsOffline ) ;
6665
67- private readonly isAdmin = toSignal ( this . store . select ( selectUserIsAdmin ) ) ;
66+ private readonly isAdmin = this . store . selectSignal ( selectUserIsAdmin ) ;
6867 private readonly navTranslates = toSignal ( this . translateService . get ( 'NAV' ) ) ;
6968 public readonly links = computed < INavItem [ ] > ( ( ) => {
7069 const isAdmin = this . isAdmin ( ) ;
@@ -106,8 +105,8 @@ export class AppComponent {
106105 /**
107106 * Whether to show authorized content (navigation, header, e.g.)
108107 */
109- public readonly isAuthorized = toSignal (
110- this . store . select ( selectAuthTokenResponse ) . pipe ( map ( ( res ) => ! ! res ) ) ,
108+ public readonly isAuthorized = this . store . selectSignal (
109+ selectAuthIsAuthorized ,
111110 ) ;
112111 /**
113112 * Side nav opened flag
0 commit comments