diff --git a/mpwo_client/src/components/Activities/ActivityDisplay.jsx b/mpwo_client/src/components/Activities/ActivityDisplay.jsx index c807edbd..50e34e1a 100644 --- a/mpwo_client/src/components/Activities/ActivityDisplay.jsx +++ b/mpwo_client/src/components/Activities/ActivityDisplay.jsx @@ -21,6 +21,13 @@ class ActivityDisplay extends React.Component { this.props.loadActivity(this.props.match.params.activityId) } + componentDidUpdate(prevProps) { + if (prevProps.match.params.activityId !== + this.props.match.params.activityId) { + this.props.loadActivity(this.props.match.params.activityId) + } + } + render() { const { activities, message, onDeleteActivity, sports } = this.props const { displayModal } = this.state @@ -41,7 +48,7 @@ class ActivityDisplay extends React.Component { {message} ) : (
- { displayModal && + {displayModal && this.setState({ displayModal: false })} />} - {activity && sport && activities.length === 1 && ( -
-
-
-
-
-
- sport logo -
-
- {title}{' '} - -