diff --git a/src/app/shared/search/search.component.spec.ts b/src/app/shared/search/search.component.spec.ts index 8c7b5b06ff6..eb280bd887d 100644 --- a/src/app/shared/search/search.component.spec.ts +++ b/src/app/shared/search/search.component.spec.ts @@ -294,6 +294,7 @@ describe('SearchComponent', () => { const expectedSearchOptions = Object.assign(paginatedSearchOptions$.value, { configuration: 'default', + scope: '', sort: sortOptionsList[0], }); expect(comp.currentConfiguration$).toBeObservable(cold('b', { diff --git a/src/app/shared/search/search.component.ts b/src/app/shared/search/search.component.ts index 3ec8a0a66e0..fefbeb44618 100644 --- a/src/app/shared/search/search.component.ts +++ b/src/app/shared/search/search.component.ts @@ -356,7 +356,7 @@ export class SearchComponent implements OnDestroy, OnInit { } this.currentScope$ = this.routeService.getQueryParameterValue('scope').pipe( - map((routeValue: string) => hasValue(routeValue) ? routeValue : this.scope), + map((routeValue: string) => hasValue(routeValue) ? routeValue : this.scope ?? ''), ); this.isSidebarCollapsed$ = this.isSidebarCollapsed();