diff --git a/client/containers/Group/MemberList/MemberList.js b/client/containers/Group/MemberList/MemberList.js index 31e952fd..2dd81d2d 100755 --- a/client/containers/Group/MemberList/MemberList.js +++ b/client/containers/Group/MemberList/MemberList.js @@ -9,7 +9,7 @@ import ErrMsg from '../../../components/ErrMsg/ErrMsg.js'; import UsernameAutoComplete from '../../../components/UsernameAutoComplete/UsernameAutoComplete.js'; const Option = Select.Option; -const arrayAddKey = (arr) => { +function arrayAddKey (arr) { return arr.map((item, index) => { return { ...item, @@ -136,6 +136,9 @@ class MemberList extends Component { componentWillReceiveProps(nextProps) { + if(this._groupId !== this._groupId){ + return null; + } if (this.props.currGroup !== nextProps.currGroup) { this.props.fetchGroupMemberList(nextProps.currGroup._id).then((res) => { this.setState({ @@ -151,7 +154,7 @@ class MemberList extends Component { } componentDidMount() { - const currGroupId = this.props.currGroup._id; + const currGroupId = this._groupId = this.props.currGroup._id; this.props.fetchGroupMsg(currGroupId).then((res) => { this.setState({ role: res.payload.data.data.role @@ -190,9 +193,9 @@ class MemberList extends Component { if (this.state.role === 'owner' || this.state.role === 'admin') { return (
- + +