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}
) : (
+ + Duration: {activity.duration} + {activity.records.find(r => r.record_type === 'LD' + ) && ( + + + + )} {' '} + {activity.pauses !== '0:00:00' && + activity.pauses !== null && ( + `(pauses: ${activity.pauses})` + )} +
++ + Distance: {activity.distance} km + {activity.records.find(r => r.record_type === 'FD' + ) && ( + + + + )} +
+
+
+ Average speed: {activity.ave_speed} km/h
+ {activity.records.find(r => r.record_type === 'AS'
+ ) && (
+
+
+
+ )}
+
+ Max speed : {activity.max_speed} km/h
+ {activity.records.find(r => r.record_type === 'MS'
+ ) && (
+
+
+
+ )}
+
+
+ Min altitude: {activity.min_alt}m
+
+ Max altitude: {activity.max_alt}m
+
+
+ Ascent: {activity.ascent}m
+
+ Descent: {activity.descent}m
+
- - Duration: {activity.duration} - {activity.records.find(r => r.record_type === 'LD') && ( - - - - )} {' '} - {activity.pauses !== '0:00:00' && - activity.pauses !== null && ( - `(pauses: ${activity.pauses})` - )} -
-- - Distance: {activity.distance} km - {activity.records.find(r => r.record_type === 'FD') && ( - - - - )} -
-
-
- Average speed: {activity.ave_speed} km/h
- {activity.records.find(r => r.record_type === 'AS') && (
-
-
-
- )}
-
- Max speed : {activity.max_speed} km/h
- {activity.records.find(r => r.record_type === 'MS') && (
-
-
-
- )}
-
-
- Min altitude: {activity.min_alt}m
-
- Max altitude: {activity.max_alt}m
-
-
- Ascent: {activity.ascent}m
-
- Descent: {activity.descent}m
-