From 1c8bba5323818b552c7acad0867afe9d1fdc671b Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Wed, 2 Mar 2022 18:50:25 +0100 Subject: [PATCH] [DSC-499] Fix issue with improper scope when switching mydspace view mode --- .../search-sidebar/search-sidebar.component.html | 1 + .../search-switch-configuration.component.ts | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/shared/search/search-sidebar/search-sidebar.component.html b/src/app/shared/search/search-sidebar/search-sidebar.component.html index e17fe941bab..e467aa02136 100644 --- a/src/app/shared/search/search-sidebar/search-sidebar.component.html +++ b/src/app/shared/search/search-sidebar/search-sidebar.component.html @@ -15,6 +15,7 @@ this.currentScope = currentScope); this.searchConfigService.getCurrentConfiguration(this.defaultConfiguration) @@ -81,9 +86,13 @@ export class SearchSwitchConfigurationComponent implements OnDestroy, OnInit { const navigationExtras: NavigationExtras = { queryParams: { configuration: this.selectedOption.value, - scope: this.currentScope }, }; + if (this.currentScope) { + navigationExtras.queryParams = Object.assign(navigationExtras.queryParams, { + scope: this.currentScope + }); + } this.changeConfiguration.emit(this.selectedOption); this.router.navigate(this.getSearchLinkParts(), navigationExtras);