From 01e0fed3c5a253ab2510766f23180ae1b7f4e508 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Wed, 14 Sep 2022 10:28:23 +0100 Subject: [PATCH] Updating language in settings needs a reload to be translated (#4431) Co-authored-by: gitstart Co-authored-by: Nitesh Singh Co-authored-by: Thiago Nascimbeni Co-authored-by: Grace Nshokano Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/pages/v2/settings/my-account/general.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/pages/v2/settings/my-account/general.tsx b/apps/web/pages/v2/settings/my-account/general.tsx index fc2d8b4d17..a12ebd13e1 100644 --- a/apps/web/pages/v2/settings/my-account/general.tsx +++ b/apps/web/pages/v2/settings/my-account/general.tsx @@ -40,6 +40,7 @@ const GeneralQueryView = (props: inferSSRProps) => { const GeneralView = ({ localeProp, t, user }: GeneralViewProps) => { const router = useRouter(); + const utils = trpc.useContext(); // const { data: user, isLoading } = trpc.useQuery(["viewer.me"]); const mutation = trpc.useMutation("viewer.updateProfile", { @@ -49,6 +50,9 @@ const GeneralView = ({ localeProp, t, user }: GeneralViewProps) => { onError: () => { showToast(t("error_updating_settings"), "error"); }, + onSettled: async () => { + await utils.invalidateQueries(["viewer.public.i18n"]); + }, }); const localeOptions = useMemo(() => {