feat: 修复新建分组后跳转到其他分组的问题

This commit is contained in:
gaoxiaolin.gao 2017-11-03 11:15:51 +08:00
parent b60ef889b9
commit 11db5f6108
2 changed files with 4 additions and 5 deletions

View File

@ -142,10 +142,9 @@ export default class GroupList extends Component {
});
await this.props.fetchGroupList();
this.setState({ groupList: this.props.groupList });
console.log('add', res.data.data);
console.log('groupList', this.state.groupList);
// this.props.setCurrGroup(res.data.data);
this.props.setCurrGroup(this.state.groupList[1]);
const id = res.data.data._id;
const currGroup = _.find(this.props.groupList, (group) => { return +group._id === +id });
this.props.setCurrGroup(currGroup);
this.props.fetchGroupMsg(this.props.currGroup._id);
this.props.fetchNewsData(this.props.currGroup._id, "group", 1, 10)
} else {
@ -167,6 +166,7 @@ export default class GroupList extends Component {
this.setState({ groupList: this.props.groupList });
const currGroup = _.find(this.props.groupList, (group) => { return +group._id === +id });
this.props.setCurrGroup(currGroup);
// this.props.setCurrGroup({ group_name, group_desc, _id: id });
this.props.fetchGroupMsg(this.props.currGroup._id);

View File

@ -118,7 +118,6 @@ class ProjectList extends Component {
return b.up_time - a.up_time;
})
projectData = [...followProject, ...noFollow]
console.log('role', this.props.currGroup.role);
return (
<div style={{ paddingTop: '24px' }} className="m-panel card-panel card-panel-s project-list" >
<Row className="project-list-header">