From 861cfdfed01c7256066d2827fe77052d2fc87e4b Mon Sep 17 00:00:00 2001 From: Bailey Pumfleet Date: Wed, 12 Jan 2022 13:46:24 +0000 Subject: [PATCH] Fix the query invalidation --- components/Shell.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/Shell.tsx b/components/Shell.tsx index 3d7f2e47..dd128867 100644 --- a/components/Shell.tsx +++ b/components/Shell.tsx @@ -360,7 +360,11 @@ function UserDropdown({ small }: { small?: boolean }) { const { t } = useLocale(); const query = useMeQuery(); const user = query.data; - const mutation = trpc.useMutation("viewer.away"); + const mutation = trpc.useMutation("viewer.away", { + onSettled() { + utils.invalidateQueries("viewer.me"); + }, + }); const utils = trpc.useContext(); return (