no page reload on username editting
This commit is contained in:
		
							parent
							
								
									38ba31f2b4
								
							
						
					
					
						commit
						28c049583a
					
				@ -69,7 +69,11 @@ export default function UserHeader ({ user }) {
 | 
				
			|||||||
              if (error) {
 | 
					              if (error) {
 | 
				
			||||||
                throw new Error({ message: error.toString() })
 | 
					                throw new Error({ message: error.toString() })
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
              window.location = `/${name}`
 | 
					              router.replace(`/${name}`)
 | 
				
			||||||
 | 
					              session.user.name = name
 | 
				
			||||||
 | 
					              user.name = name
 | 
				
			||||||
 | 
					              setEditting(false)
 | 
				
			||||||
 | 
					              // alternative is setting window.location = /name
 | 
				
			||||||
            }}
 | 
					            }}
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <Input
 | 
					            <Input
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user