diff --git a/src/app/app.component.ts b/src/app/app.component.ts index be0a70745..58b587072 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -303,7 +303,7 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { this.subs.add( this.store$ .select(userStore.getUserAuth) - .pipe(filter((userAuth) => !!userAuth?.token)) + .pipe(filter((userAuth) => !!userAuth.token)) .subscribe((_) => this.store$.dispatch(new userStore.LoadProfile())), ); @@ -361,13 +361,10 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { ), ); - this.subs.add( - this.authService.getUser().subscribe((user) => { - if (user?.id) { - this.store$.dispatch(new userStore.Login(user)); - } - }), - ); + const user = this.authService.getUser(); + if (user.id) { + this.store$.dispatch(new userStore.Login(user)); + } this.subs.add( this.actions$ diff --git a/src/app/components/header/header-buttons/header-buttons.component.ts b/src/app/components/header/header-buttons/header-buttons.component.ts index e09de5402..021276ad5 100644 --- a/src/app/components/header/header-buttons/header-buttons.component.ts +++ b/src/app/components/header/header-buttons/header-buttons.component.ts @@ -26,7 +26,6 @@ import { AsfApiService, EnvironmentService, ScreenSizeService, - UserDataService, } from '@services'; import { CMRProduct, @@ -80,7 +79,6 @@ declare global { }) export class HeaderButtonsComponent implements OnInit, OnDestroy { authService = inject(AuthService); - userData = inject(UserDataService); env = inject(EnvironmentService); private http = inject(HttpClient); asfApiService = inject(AsfApiService); @@ -140,9 +138,9 @@ export class HeaderButtonsComponent implements OnInit, OnDestroy { ngOnInit() { this.subs.add( - this.store$.select(userStore.getUserAuth).subscribe((user) => { - this.userAuth = user; - }), + this.store$ + .select(userStore.getUserAuth) + .subscribe((user) => (this.userAuth = user)), ); this.subs.add( diff --git a/src/app/components/header/header-buttons/preferences/preferences.component.html b/src/app/components/header/header-buttons/preferences/preferences.component.html index c2967b398..e3193a416 100644 --- a/src/app/components/header/header-buttons/preferences/preferences.component.html +++ b/src/app/components/header/header-buttons/preferences/preferences.component.html @@ -1,6 +1,6 @@