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
[x] Go to profile
[x] Change avatar
[x] See if avatar is updated in the header
[x] Go to /new-post through '+' button on profile
[x] See if avatar is updated in the post banner
[x] Reload post creation page
[x] See if post banner content is still correct
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
[x] a. Tested happy flow.
[x] b. Tested unhappy flow.
[x] c. No unexpected exceptions.
[x] d. No code with high complexity. (Big O)
[x] e. EOF newline.
[x] f. No linter warnings or errors.
2. If relevant, front-end checklist
[x] a. Responsive. (Desktop all the way to mobile 320px)
[x] b. Using SCSS variables where relevant.
[x] c. Relevant class names
[x] d. No modified global SCSS properties, except if necessary and fully tested the impact.
[x] e. Checked caniuse for more modern CSS properties.
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