Updating language in settings needs a reload to be translated (#4431)

Co-authored-by: gitstart <gitstart@users.noreply.github.com>
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
Co-authored-by: Grace Nshokano <grace.devolop@gmail.com>
Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-09-14 09:28:23 +00:00
1 parent c09107cec8
commit 01e0fed3c5
1 file changed
+4
@@ -40,6 +40,7 @@ const GeneralQueryView = (props: inferSSRProps<typeof getServerSideProps>) => {
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(() => {