[ACA-2045] reset selection on toggle join action (#829)

This commit is contained in:
Suzana Dirla
2018-11-26 15:51:33 +00:00
committed by Denys Vuika
parent 32083576c3
commit 8952be634f
2 changed files with 10 additions and 0 deletions
@@ -34,6 +34,7 @@ import {
SnackbarErrorAction,
SnackbarInfoAction
} from '../../../store/actions/snackbar.actions';
import { SetSelectedNodesAction } from '../../../store/actions/node.actions';
@Component({
selector: 'app-toggle-join-library',
@@ -98,6 +99,13 @@ export class ToggleJoinLibraryComponent {
if (event.shouldReload) {
this.content.libraryJoined.next();
} else {
if (event.updatedEntry) {
this.store.dispatch(
new SetSelectedNodesAction([
<any>{ entry: event.updatedEntry, isLibrary: true }
])
);
}
this.content.joinLibraryToggle.next();
}
}
@@ -84,6 +84,7 @@ export class LibraryMembershipDirective implements OnChanges {
this.targetSite.joinRequested = false;
this.isJoinRequested.next(false);
const info = {
updatedEntry: this.targetSite,
shouldReload: false,
i18nKey: 'APP.MESSAGES.INFO.JOIN_CANCELED'
};
@@ -117,6 +118,7 @@ export class LibraryMembershipDirective implements OnChanges {
this.toggle.emit(info);
} else {
const info = {
updatedEntry: this.targetSite,
shouldReload: false,
i18nKey: 'APP.MESSAGES.INFO.JOIN_REQUESTED'
};