Web: People: fixed updating avatar in user list after creating new user
This commit is contained in:
parent
0836a55d68
commit
0a248e6f3b
@ -22,7 +22,10 @@ import {
|
||||
createProfile,
|
||||
updateCreatedAvatar,
|
||||
} from "../../../../../store/profile/actions";
|
||||
import { setFilter } from "../../../../../store/people/actions";
|
||||
import {
|
||||
setFilter,
|
||||
updateProfileInUsers,
|
||||
} from "../../../../../store/people/actions";
|
||||
import {
|
||||
MainContainer,
|
||||
AvatarContainer,
|
||||
@ -82,6 +85,7 @@ class CreateUserForm extends React.Component {
|
||||
})
|
||||
.then((res) => {
|
||||
this.props.updateCreatedAvatar(res);
|
||||
this.props.updateProfileInUsers();
|
||||
toastr.success(this.props.t("ChangesSavedSuccessfully"));
|
||||
this.props.history.push(
|
||||
`${this.props.settings.homepage}/view/${userName}`
|
||||
@ -602,4 +606,5 @@ export default connect(mapStateToProps, {
|
||||
createProfile,
|
||||
updateCreatedAvatar,
|
||||
setFilter,
|
||||
updateProfileInUsers,
|
||||
})(withRouter(withTranslation()(CreateUserForm)));
|
||||
|
@ -245,12 +245,16 @@ export function resetFilter() {
|
||||
|
||||
export function updateProfileInUsers(updatedProfile) {
|
||||
return (dispatch, getState) => {
|
||||
if (!updatedProfile) {
|
||||
const { profile } = getState();
|
||||
updatedProfile = profile.targetUser;
|
||||
}
|
||||
|
||||
const { userName } = updatedProfile;
|
||||
const { people } = getState();
|
||||
const { users } = people;
|
||||
|
||||
if (!users) {
|
||||
const { filter } = people;
|
||||
return updateUserList(dispatch);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user