Change comments from current user fetches since profileImage wasn't added to attributes

This commit is contained in:
Vesa Luusua 2017-09-14 22:03:50 +03:00
parent 96b1ddaaec
commit 9a8642b752
3 changed files with 2 additions and 6 deletions

View file

@ -12,8 +12,6 @@ const Avatar = props => {
const avatarUser = ensureUser(user);
const { displayName, abbreviatedName } = avatarUser.attributes.profile;
// TODO this is a temporary avatar fix for currentUser's profile data.
// Avatar images should be included to all user's attributes in the future.
if (avatarUser.profileImage && avatarUser.profileImage.id) {
return (
<div className={classes} title={displayName}>

View file

@ -133,8 +133,7 @@ export const updateProfile = actionPayload => {
.then(response => {
dispatch(updateProfileSuccess(response));
// Temporary denormalization for profileImage
// Profile image will be included to users
// Include profile image to denormalized user entity
const currentUserId = response.data.data.id;
const entities = updatedEntities({}, response.data);
const denormalised = denormalisedEntities(entities, 'current-user', [currentUserId]);

View file

@ -321,8 +321,7 @@ export const fetchCurrentUser = () =>
return sdk.currentUser
.show({ include: ['profileImage'] })
.then(response => {
// Temporary denormalization for profileImage
// Profile image will be included to users
// Include profile image to denormalized user entity
const currentUserId = response.data.data.id;
const entities = updatedEntities({}, response.data);
const denormalised = denormalisedEntities(entities, 'current-user', [currentUserId]);