write updated usernames to cache

This commit is contained in:
keyan 2021-09-07 08:25:19 -05:00
parent d204f4b6b8
commit ffca502625
1 changed files with 13 additions and 2 deletions

View File

@ -71,9 +71,20 @@ export default function UserHeader ({ user }) {
}
router.replace(`/${name}`)
session.user.name = name
user.name = name
client.writeFragment({
id: `User:${user.id}`,
fragment: gql`
fragment CurUser on User {
name
}
`,
data: {
name
}
})
setEditting(false)
// alternative is setting window.location = /name
}}
>
<Input