From ad3a06384f040caac610cfb35f77c0e8b4db7046 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Thu, 23 Sep 2021 23:30:09 +0100 Subject: [PATCH 1/2] Fixes a crash caused by too many redraws (#759) --- lib/hooks/useLocale.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/hooks/useLocale.ts b/lib/hooks/useLocale.ts index 0022c527..ed61be92 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, From 9e785c01fdda87faf2839b2f01e56e6f136e2b53 Mon Sep 17 00:00:00 2001 From: Bailey Pumfleet Date: Thu, 23 Sep 2021 23:31:16 +0100 Subject: [PATCH 2/2] The tiniest linting fix ever --- components/ui/PoweredByCalendso.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ui/PoweredByCalendso.tsx b/components/ui/PoweredByCalendso.tsx index c7e72417..79201f9b 100644 --- a/components/ui/PoweredByCalendso.tsx +++ b/components/ui/PoweredByCalendso.tsx @@ -16,4 +16,4 @@ const PoweredByCalendso = () => ( ); -export default PoweredByCalendso; \ No newline at end of file +export default PoweredByCalendso;