diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.html b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html index 367f76e9..b66690d0 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.html @@ -22,14 +22,9 @@ + [checked]="state.fuzzySearch()"> Fuzzy Search @@ -77,8 +72,8 @@ [active]="rla.isActive" [queryParams]="{ keywords: state.payload()?.keywords?.join(','), - fuzzy: tabFuzzyValue(route), - topics: tabFuzzyValue(route) ? state.topicIds() : null, + fuzzy: state.payload()?.options?.fuzzy, + topics: state.payload()?.options?.fuzzy ? state.topicIds() : null, topicId: null, }" queryParamsHandling="replace"> diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts index 6eea693b..2d73ed7b 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, inject, signal } from '@angular/core'; +import { Component, computed, inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ActivatedRoute, @@ -76,8 +76,6 @@ export class KeywordsSearchResultsComponent { { path: 'trends', label: 'Visualisierung', icon: BAR_CHART_ICON }, ]; - private readonly lastUserFuzzy = signal(false); - readonly selectedKeywordCount = computed(() => this.state.keywords().length); readonly allKeywordEntries = computed(() => { const seen = new Set(); @@ -100,12 +98,7 @@ export class KeywordsSearchResultsComponent { // previous search never gets silently applied to a new one. this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => { const keywords = this.parseKeywordList(params.get('keywords')); - const onPersonsTab = this.isPersonsTab(); - const fuzzySearch = onPersonsTab || params.get('fuzzy') === 'true'; - - if (!onPersonsTab) { - this.lastUserFuzzy.set(params.get('fuzzy') === 'true'); - } + const fuzzySearch = params.get('fuzzy') === 'true'; const cached = this.readHandoffCache(); const cacheMatches = @@ -120,22 +113,9 @@ export class KeywordsSearchResultsComponent { ? cached!.patentKeywordEntries : undefined, }); - - if (onPersonsTab && params.get('fuzzy') !== 'true') { - this.updateQueryParams(true); - } }); } - // the Fuzzy Search toggle is locked on while the Personen tab is active - isPersonsTab(): boolean { - return this.route.snapshot.firstChild?.routeConfig?.path === 'persons'; - } - - tabFuzzyValue(route: { path: string }): boolean { - if (route.path === 'persons') return true; - return this.lastUserFuzzy(); - } goBackToSearch(): void { void this.router.navigate(['/keywords'], { queryParamsHandling: 'merge',