AjobK / Seaqull

Seaqull programming blog
http://www.seaqull.com
3 stars 0 forks source link

335 bad avatar new post #384

Closed jerohero closed 2 years ago

jerohero commented 2 years ago

closes #335


What is it supposed to do
Fixes the bug where updating the avatar would only update it in the component and not in the header, new post page or any other page visited in the same session. While working on this I also discovered that reloading the post creation page would cause the user information in the post banner to be undefined, so this branch also contains a fix for this.


How can we test your branch


Additional notes
Fixing these issues introduced me to the fact that the author object is stored differently after fetching the post and in the store. This caused another issue where the display name would fill correctly when reloading the page (fetched user data from store), but not when visiting an already existing page. The store saves the _displayname field as _displayname while the post fetch saves it as name.

I don't think the store should be saving the display name in snake_case, and it might be bad that there are different representations of user data throughout the code.


1. General checklist


2. If relevant, front-end checklist


4. If relevant, test these browsers