fix fuzzy / keyword names on chips

This commit is contained in:
Kazgatari
2026-07-31 14:08:24 +02:00
parent 9f10e9e7af
commit d4daecd921
2 changed files with 9 additions and 5 deletions
@@ -212,6 +212,9 @@ export class UniTrendParentComponent implements OnInit {
getMappedTopic(topicOrKeyword: string): string {
if (!topicOrKeyword) return '';
if (!this.isFuzzy()) {
return topicOrKeyword;
}
const cleanId = cleanEntityId(topicOrKeyword);
const isTopicId =
@@ -1040,7 +1043,7 @@ export class UniTrendParentComponent implements OnInit {
updateUrlParams() {
const queryParams: any = {
search_type: this.selectedSearchType(),
trend_topics: this.selectedTrendTopics(),
trend_topics: this.isFuzzy() ? this.selectedTrendTopics() : null,
institutions:
this.comparisonInstitutions().length > 0
? this.comparisonInstitutions().map(
@@ -66,10 +66,10 @@ export const uniTrendResolver: ResolveFn<UniTrendResolvedData> = (
keywords = searchState.keywords();
}
let topics = [
...params.getAll('trend_topics'),
...params.getAll('trend_topic'),
];
let topics = fuzzy
? [...params.getAll('trend_topics'), ...params.getAll('trend_topic')]
: [];
if (topics.length === 0) {
const rawTopicsList = [
...params.getAll('topic'),
@@ -97,6 +97,7 @@ export const uniTrendResolver: ResolveFn<UniTrendResolvedData> = (
? searchState.topicsList()
: searchState.keywords();
if (
!fuzzy ||
topics.length === 0 ||
(fuzzy &&
stateTopics.length > 0 &&