Skip to content
Snippets Groups Projects
Commit 42511297 authored by Lucas Eduardo Schoenfelder's avatar Lucas Eduardo Schoenfelder
Browse files

added rename avatar attribute logic to action user logged in

parent 7b68813a
No related branches found
No related tags found
3 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system
...@@ -67,6 +67,16 @@ function reducer(state, action) { ...@@ -67,6 +67,16 @@ function reducer(state, action) {
windowSize: action.innerWindow windowSize: action.innerWindow
} }
case 'USER_LOGGED_IN': case 'USER_LOGGED_IN':
if (action.login.avatar_file_name) {
Object.defineProperty(action.login, 'avatar',
Object.getOwnPropertyDescriptor(action.login, 'avatar_file_name'));
delete action.login['avatar_file_name'];
}
if (action.login.cover_file_name) {
Object.defineProperty(action.login, 'cover',
Object.getOwnPropertyDescriptor(action.login, 'cover_file_name'));
delete action.login['cover_file_name'];
}
return { return {
...state, ...state,
userIsLoggedIn:action.userLoggedIn, userIsLoggedIn:action.userLoggedIn,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment