Skip to content

Commit

Permalink
Fixes #638
Browse files Browse the repository at this point in the history
  • Loading branch information
zdmc23 committed Jul 11, 2022
1 parent b45c82e commit bd2aa6b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/Picker/LanguagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ import useI18N from "hooks/use-i18n";
import useSettings from "hooks/use-settings";

const LanguagePicker = () => {
const { i18n, selectedEndonym } = useI18N();
const { settings } = useSettings();
const availableTranslations = settings?.available_translations?.map(
let availableTranslations = settings?.available_translations?.map(
(translation) => translation?.language
);
const { i18n, selectedEndonym } = useI18N();
if (!availableTranslations) {
availableTranslations = Object.keys(i18n.translations);
}
const { expand } = useBottomSheet();
const showLanguageSheet = () => {
expand({
Expand All @@ -27,7 +30,6 @@ const LanguagePicker = () => {
),
});
};
if (!availableTranslations) return null;
return (
<Picker
icon={<TranslateIcon />}
Expand Down

0 comments on commit bd2aa6b

Please sign in to comment.