[ACS-8961] Remove expandedSidenav from local storage upon logout (#4242)

* [ACS-8961] Remove expandedSidenav from local storage on logout

* [ACS-8961] fix sonarcloud issue
This commit is contained in:
Mykyta Maliarchuk
2024-12-20 15:53:19 +01:00
committed by GitHub
parent 66f701367b
commit d6f859dd74
2 changed files with 31 additions and 5 deletions

View File

@@ -23,8 +23,15 @@
*/
import { inject, Injectable } from '@angular/core';
import { AppConfigService, AuthenticationService, NotificationService, PageTitleService, UserPreferencesService } from '@alfresco/adf-core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import {
AuthenticationService,
AppConfigService,
PageTitleService,
UserPreferencesService,
NotificationService,
StorageService
} from '@alfresco/adf-core';
import { Observable, BehaviorSubject, Subject } from 'rxjs';
import {
AlfrescoApiService,
FileUploadErrorEvent,
@@ -92,7 +99,8 @@ export class AppService implements ShellAppService {
searchQueryBuilderService: SearchQueryBuilderService,
private acaMobileAppSwitcherService: AcaMobileAppSwitcherService,
private appSettingsService: AppSettingsService,
private userProfileService: UserProfileService
private readonly userProfileService: UserProfileService,
private readonly storage: StorageService
) {
this.ready = new BehaviorSubject(this.authenticationService.isLoggedIn() || this.withCredentials);
this.ready$ = this.ready.asObservable();
@@ -103,6 +111,7 @@ export class AppService implements ShellAppService {
});
this.authenticationService.onLogout.subscribe(() => {
this.storage.removeItem(this.preferencesService.getPropertyKey('expandedSidenav'));
searchQueryBuilderService.resetToDefaults();
acaMobileAppSwitcherService.clearSessionExpireTime();
acaMobileAppSwitcherService.closeDialog();