diff --git a/SwimTracker/views/LastSessionsView.js b/SwimTracker/views/LastSessionsView.js index 92829ab..cb9af50 100644 --- a/SwimTracker/views/LastSessionsView.js +++ b/SwimTracker/views/LastSessionsView.js @@ -181,7 +181,7 @@ async function getFullData(swimTrackerHost, analysisSettings) { e.analysis = da.analyze(analysisSettings, e.startTime, e.values); } console.log("full data", parsed); - return parsed; + return parsed.reverse(); } // --------------------------------------------------------------------------------------------- @@ -206,9 +206,6 @@ class LastSessionsView extends React.Component { request({ url: "http://" + this.props.swimTrackerHost + "/webdav/" + sessionFileName, method: "DELETE" }) .then((value) => console.log("Successfully deleted", sessionFileName, value)) .catch((err) => console.error("Failed to delete", sessionFileName, err)); - //this.setState({ sessions: null }); - //await request({ url: "http://" + this.props.swimTrackerHost + "/webdav/" + sessionFileName, method: "DELETE" }); - //this.setState({ sessions: await getFullData(this.props.swimTrackerHost, this.props.analysisSettings) }); }; const onRefresh = async () => { @@ -224,7 +221,7 @@ class LastSessionsView extends React.Component { style={{ width: "100%" }} keyExtractor={item => item.startTime.toString()} disableRightSwipe={true} - data={this.state.sessions.reverse()} + data={this.state.sessions} renderItem={(data, rowMap) => (