From 6316b47fbbedd52e1678cb94f88d820378da5268 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Thu, 17 Oct 2019 22:51:08 +0200 Subject: [PATCH] fix: update timeline without reload Rather than pinging the server, this uses the current time. It should almost always be the same and only lasts until reload. --- client/src/redux/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/redux/index.js b/client/src/redux/index.js index bc23446b14..4e984fa43b 100644 --- a/client/src/redux/index.js +++ b/client/src/redux/index.js @@ -311,9 +311,11 @@ export const reducer = handleActions( } }), [types.submitComplete]: (state, { payload: { id, challArray } }) => { - let submitedchallneges = [{ id }]; + // TODO: possibly more of the payload (files?) should be added + // to the completedChallenges array. + let submittedchallenges = [{ id, completedDate: Date.now() }]; if (challArray) { - submitedchallneges = challArray; + submittedchallenges = challArray; } const { appUsername } = state; return { @@ -325,7 +327,7 @@ export const reducer = handleActions( ...state.user[appUsername], completedChallenges: uniqBy( [ - ...submitedchallneges, + ...submittedchallenges, ...state.user[appUsername].completedChallenges ], 'id'