From babf2fb2adaf4f81fc8e9d7b6e95a460cd71b7ce Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Tue, 4 Sep 2018 15:56:53 +0300 Subject: [PATCH] [ACA-1748] Logout - reset selection (#599) --- .../components/current-user/current-user.component.html | 2 +- .../components/current-user/current-user.component.ts | 9 +++++++-- src/app/store/states/app.state.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/components/current-user/current-user.component.html b/src/app/components/current-user/current-user.component.html index 68143330e..7228fe4b8 100644 --- a/src/app/components/current-user/current-user.component.html +++ b/src/app/components/current-user/current-user.component.html @@ -25,7 +25,7 @@ {{ 'APP.SETTINGS.TITLE' | translate }} - diff --git a/src/app/components/current-user/current-user.component.ts b/src/app/components/current-user/current-user.component.ts index d711ce178..efd0aa26b 100644 --- a/src/app/components/current-user/current-user.component.ts +++ b/src/app/components/current-user/current-user.component.ts @@ -29,6 +29,7 @@ import { Observable } from 'rxjs'; import { selectUser, appLanguagePicker } from '../../store/selectors/app.selectors'; import { AppStore } from '../../store/states'; import { ProfileState } from '@alfresco/adf-extensions'; +import { SetSelectedNodesAction } from '../../store/actions'; @Component({ selector: 'aca-current-user', @@ -40,8 +41,12 @@ export class CurrentUserComponent { profile$: Observable; languagePicker$: Observable; - constructor(store: Store) { - this.profile$ = store.select(selectUser); + constructor(private store: Store) { + this.profile$ = this.store.select(selectUser); this.languagePicker$ = store.select(appLanguagePicker); } + + onLogoutEvent() { + this.store.dispatch(new SetSelectedNodesAction([])); + } } diff --git a/src/app/store/states/app.state.ts b/src/app/store/states/app.state.ts index 1f56f9c9f..981f017f5 100644 --- a/src/app/store/states/app.state.ts +++ b/src/app/store/states/app.state.ts @@ -45,7 +45,7 @@ export const INITIAL_APP_STATE: AppState = { languagePicker: false, sharedUrl: '', user: { - isAdmin: true, // 5.2.x + isAdmin: null, id: null, firstName: '', lastName: ''