fix: refresh UserDropdown after update (#1352)
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
		
							parent
							
								
									94a10992d2
								
							
						
					
					
						commit
						38f762f7b2
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -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 a new issue
	
	 Joel Lu
						Joel Lu