diff --git a/packages/app/components/languageSwitcher/LanguageSwitcher.tsx b/packages/app/components/languageSwitcher/LanguageSwitcher.tsx index 8c90d1e..0898f8e 100644 --- a/packages/app/components/languageSwitcher/LanguageSwitcher.tsx +++ b/packages/app/components/languageSwitcher/LanguageSwitcher.tsx @@ -17,9 +17,11 @@ const LanguageSwitcher: ComponentType = ({ onClose = () => {} }) => { const onChangeLang = useCallback( (lang: string) => { - dispatch(changeLang(lang)); - // TODO: await language change and close popup, but not earlier than after 300ms - setTimeout(onClose, 300); + Promise.all([ + // 300ms is necessary for the visual animation of the language change to be completed + new Promise((resolve) => setTimeout(resolve, 300)), + dispatch(changeLang(lang)), + ]).then(onClose); }, [dispatch, onClose], );