-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating displayName Reactive #2994 #3403
Conversation
So cool. Thank you for your contribution. I'll review it tomorrow 😊 |
⛔ Feature branch deployment currently inactive.If the PR is still open, you can add the |
frontend/src/views/Profile.vue
Outdated
methods: { | ||
reloadUser() { | ||
this.api.reload(this.user).then((user) => { | ||
this.$store.commit('login', user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this more easily understandable, could you add another mutation called "updateUser" to
frontend/src/components/store/auth.js, and then use that here?
The mutation code (single line) will be duplicated, but what we're doing here isn't really a re-login, but an update of the user state. Maybe these two actions will have different behaviour in the future.
I also noticed the update is not applied if I navigate away from the profile edit during the save operation (I was testing on my phone). Not sure how to solve this though... |
Maybe it was also a bad idea of us in the first place, to store a duplicated user state in the auth store. Maybe we would be better off storing only the user URI (which we get from the JWT from the API) there, and reading the user data from the normal API store when needed. But this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@DeNic0la: Very cool - thx! |
PR for issue #2994
Reload user entity after changing
firstname
,surname
ornickname