Round 3 of Bugfixing (#3318)

This commit is contained in:
Joe Milazzo 2024-10-28 18:13:48 -05:00 committed by GitHub
parent 727fbd353b
commit abdf15b895
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 482 additions and 489 deletions

View file

@ -9,16 +9,10 @@ import {shareReplay} from "rxjs/operators";
})
export class LanguageNamePipe implements PipeTransform {
constructor(private metadataService: MetadataService) {
}
constructor(private metadataService: MetadataService) {}
transform(isoCode: string): Observable<string> {
// TODO: See if we can speed this up. It rarely changes and is quite heavy to download on each page
return this.metadataService.getAllValidLanguages().pipe(map(lang => {
const l = lang.filter(l => l.isoCode === isoCode);
if (l.length > 0) return l[0].title;
return '';
}), shareReplay());
return this.metadataService.getLanguageNameForCode(isoCode).pipe(shareReplay());
}
}