fix: institution visisbility button & refactor ID type (full OpenAlex link vs ID) into parent component
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -109,8 +109,17 @@ export class AuthorSelectorComponent {
|
||||
this.toggleVisibility.emit(id);
|
||||
}
|
||||
|
||||
private cleanId(id: string | undefined): string {
|
||||
if (!id) return '';
|
||||
const lower = id.toLowerCase().trim();
|
||||
return lower.includes('/') ? lower.split('/').pop()! : lower;
|
||||
}
|
||||
|
||||
isAlreadyAdded(id: string | undefined): boolean {
|
||||
if (!id) return false;
|
||||
return this.comparisonAuthors().some((i) => i.id === id);
|
||||
const cleanTarget = this.cleanId(id);
|
||||
return this.comparisonAuthors().some(
|
||||
(i) => this.cleanId(i.id) === cleanTarget,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user