fix: refresh UserDropdown after update (#1352)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/1349/head^2
parent
94a10992d2
commit
38f762f7b2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue