From edb1b0c1e24b8f01ed23e83322b9a1ad5a4eacbe Mon Sep 17 00:00:00 2001 From: Jeff Reiffers Date: Fri, 25 Oct 2024 11:01:18 +0200 Subject: [PATCH] fix: do not display language if not exists --- .../details-page/components/banner/index.tsx | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/details-page/components/banner/index.tsx b/src/components/details-page/components/banner/index.tsx index 6d076c3d5..81d3c45ec 100755 --- a/src/components/details-page/components/banner/index.tsx +++ b/src/components/details-page/components/banner/index.tsx @@ -70,19 +70,16 @@ const Banner: FC = ({ {languages .filter( ({ code, selected }) => - code !== translations.getLanguage() && selected + code !== translations.getLanguage() && + selected && + title[code as LanguageType] ) - .map(({ code }, index) => { - const typedCode = code as LanguageType; - return ( - - {`${index > 0 ? ', ' : ''}${ - translations.shortLang[code] - }: `} - {title[typedCode]} - - ); - })} + .map(({ code }, index) => ( + + {`${index > 0 ? ', ' : ''}${translations.shortLang[code]}: `} + {title[code as LanguageType]} + + ))} )}