From 85def2b2e0f62b2ef9c743990a6deff767a01ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Stefa=C5=84czyk?= Date: Tue, 30 Apr 2024 15:56:48 +0200 Subject: [PATCH] revert more irrelevant changes --- src/frontend/App.tsx | 1 - src/frontend/contexts/IntlContext.tsx | 4 ++-- src/frontend/hooks/persistedState/usePersistedLocale.ts | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/frontend/App.tsx b/src/frontend/App.tsx index be62a8648..c5430dabf 100644 --- a/src/frontend/App.tsx +++ b/src/frontend/App.tsx @@ -31,7 +31,6 @@ initializeNodejs(); const App = () => { const navRef = useNavigationContainerRef(); const [permissionsAsked, setPermissionsAsked] = React.useState(false); - React.useEffect(() => { PermissionsAndroid.requestMultiple([ 'android.permission.CAMERA', diff --git a/src/frontend/contexts/IntlContext.tsx b/src/frontend/contexts/IntlContext.tsx index eac645032..891a9f33f 100644 --- a/src/frontend/contexts/IntlContext.tsx +++ b/src/frontend/contexts/IntlContext.tsx @@ -88,9 +88,9 @@ function onError(e: Error) { export function getSupportedLocale( locale: string, ): keyof typeof languages | undefined { - if (supportedLanguages?.find(lang => lang.locale === locale)) + if (supportedLanguages.find(lang => lang.locale === locale)) return locale as keyof typeof languages; const nonRegionalLocale = locale.split('-')[0]; - if (supportedLanguages?.find(({locale}) => locale === nonRegionalLocale)) + if (supportedLanguages.find(({locale}) => locale === nonRegionalLocale)) return nonRegionalLocale as keyof typeof languages; } diff --git a/src/frontend/hooks/persistedState/usePersistedLocale.ts b/src/frontend/hooks/persistedState/usePersistedLocale.ts index 2446a0e81..c541ceaa2 100644 --- a/src/frontend/hooks/persistedState/usePersistedLocale.ts +++ b/src/frontend/hooks/persistedState/usePersistedLocale.ts @@ -8,7 +8,6 @@ type LocaleSlice = { setLocale: (locale: string) => void; }; - const localeSlice: StateCreator = (set, get) => ({ // We can use this non-null assertion with `getLocales()` because, according // to [the docs][1], the result is "guaranteed to contain at least 1 element."