Updated GroupPage to fetch group on component update if id changes
• Updated: - GroupPage to fetch group on component update if id changes • Fixes: - Issue where going from group -> group (like from shortcut to shortcut) and the group children components dont update
This commit is contained in:
parent
985faeb930
commit
af7c82221d
|
@ -16,14 +16,22 @@ import Divider from '../components/divider'
|
||||||
class GroupPage extends ImmutablePureComponent {
|
class GroupPage extends ImmutablePureComponent {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
if (!this.props.group) {
|
||||||
this.props.dispatch(fetchGroup(this.props.params.id))
|
this.props.dispatch(fetchGroup(this.props.params.id))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
//Reset group composer
|
//Reset group composer
|
||||||
this.props.dispatch(changeComposeGroupId(null))
|
this.props.dispatch(changeComposeGroupId(null))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
if (!!this.props.group && prevProps.params.id !== this.props.params.id) {
|
||||||
|
this.props.dispatch(fetchGroup(this.props.params.id))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
intl,
|
intl,
|
||||||
|
|
Loading…
Reference in New Issue