Skip to content

Scheduling infrastructure for absolutely everyone.

Fixes a crash caused by too many redraws (#759)

Alex van Andelad3a06384f04
diff --git a/lib/hooks/useLocale.ts b/lib/hooks/useLocale.ts
index 0022c5275eb..ed61be924af 100644
--- a/lib/hooks/useLocale.ts
+++ b/lib/hooks/useLocale.ts
@@ -1,5 +1,4 @@
import { useTranslation } from "next-i18next";
-import { useEffect } from "react";
type LocaleProps = {
localeProp: string;
@@ -8,9 +7,9 @@ type LocaleProps = {
export const useLocale = (props: LocaleProps) => {
const { i18n, t } = useTranslation("common");
- useEffect(() => {
- (async () => await i18n.changeLanguage(props.localeProp))();
- }, [i18n, props.localeProp]);
+ if (i18n.language !== props.localeProp) {
+ i18n.changeLanguage(props.localeProp);
+ }
return {
i18n,