[ACA-1748] Logout - reset selection (#599)

This commit is contained in:
Cilibiu Bogdan 2018-09-04 15:56:53 +03:00 committed by Denys Vuika
parent df58726938
commit babf2fb2ad
3 changed files with 9 additions and 4 deletions

View File

@ -25,7 +25,7 @@
{{ 'APP.SETTINGS.TITLE' | translate }}
</button>
<button mat-menu-item adf-logout>
<button mat-menu-item (click)="onLogoutEvent()" adf-logout>
{{ 'APP.SIGN_OUT' | translate }}
</button>
</mat-menu>

View File

@ -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<ProfileState>;
languagePicker$: Observable<boolean>;
constructor(store: Store<AppStore>) {
this.profile$ = store.select(selectUser);
constructor(private store: Store<AppStore>) {
this.profile$ = this.store.select(selectUser);
this.languagePicker$ = store.select(appLanguagePicker);
}
onLogoutEvent() {
this.store.dispatch(new SetSelectedNodesAction([]));
}
}

View File

@ -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: ''