Skip to content

Commit

Permalink
fix: refresh UserDropdown after update (#1352)
Browse files Browse the repository at this point in the history
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
  • Loading branch information
zzwt and PeerRich committed Dec 18, 2021
1 parent 94a1099 commit 38f762f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/settings/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ function SettingsView(props: ComponentProps<typeof Settings> & { localeProp: str
const { t } = useLocale();
const router = useRouter();
const mutation = trpc.useMutation("viewer.updateProfile", {
onSuccess: () => {
onSuccess: async () => {
showToast(t("your_user_profile_updated_successfully"), "success");
setHasErrors(false); // dismiss any open errors
await utils.invalidateQueries(["viewer.me"]);
},
onError: (err) => {
setHasErrors(true);
Expand Down

0 comments on commit 38f762f

Please sign in to comment.