From 8952be634fdb2b2b37d0c0f22505218684e1a3d1 Mon Sep 17 00:00:00 2001 From: Suzana Dirla Date: Mon, 26 Nov 2018 17:51:33 +0200 Subject: [PATCH] [ACA-2045] reset selection on toggle join action (#829) --- .../toggle-join-library/toggle-join-library.component.ts | 8 ++++++++ src/app/directives/library-membership.directive.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.ts b/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.ts index 2210b096b..a9283a430 100644 --- a/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.ts +++ b/src/app/components/toolbar/toggle-join-library/toggle-join-library.component.ts @@ -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([ + { entry: event.updatedEntry, isLibrary: true } + ]) + ); + } this.content.joinLibraryToggle.next(); } } diff --git a/src/app/directives/library-membership.directive.ts b/src/app/directives/library-membership.directive.ts index 1d2ae0957..8f9c5710c 100644 --- a/src/app/directives/library-membership.directive.ts +++ b/src/app/directives/library-membership.directive.ts @@ -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' };