diff --git a/src/components/Controls/Controls.tsx b/src/components/Controls/Controls.tsx index c1a5a9b9..ac2723ca 100644 --- a/src/components/Controls/Controls.tsx +++ b/src/components/Controls/Controls.tsx @@ -54,6 +54,10 @@ type Defined = { [P in keyof ControlsProps]-?: ControlsProps[P]; }; +function hasLangs(langs?: Lang[]) { + return langs?.length && langs.length > 1; +} + const Controls = memo((props) => { const {isVerticalView} = useContext(ControlsLayoutContext); const { @@ -88,7 +92,7 @@ const Controls = memo((props) => { const withSettingsControl = Boolean( onChangeWideFormat || onChangeTheme || onChangeShowMiniToc || onChangeTextSize, ); - const withLangControl = Boolean(lang && onChangeLang); + const withLangControl = Boolean(lang && hasLangs(langs) && onChangeLang); const withSinglePageControl = Boolean(onChangeSinglePage); const withPdfControl = Boolean(pdfLink); const withEditControl = Boolean(!singlePage && !hideEditControl && vcsUrl);