no page reload on username editting

This commit is contained in:
keyan 2021-09-02 17:40:46 -05:00
parent 38ba31f2b4
commit 28c049583a

View File

@ -69,7 +69,11 @@ export default function UserHeader ({ user }) {
if (error) {
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