Skip to content

Commit

Permalink
fix: update timeline without reload
Browse files Browse the repository at this point in the history
Rather than pinging the server, this uses the current time.  It should
almost always be the same and only lasts until reload.
  • Loading branch information
ojeytonwilliams authored and scissorsneedfoodtoo committed Oct 18, 2019
1 parent 892e686 commit 6316b47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/src/redux/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -325,7 +327,7 @@ export const reducer = handleActions(
...state.user[appUsername],
completedChallenges: uniqBy(
[
...submitedchallneges,
...submittedchallenges,
...state.user[appUsername].completedChallenges
],
'id'
Expand Down

0 comments on commit 6316b47

Please sign in to comment.