Skip to content

Commit

Permalink
fix(dashboard): completedAt was overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
rap2hpoutre committed Mar 25, 2022
1 parent 86b16c4 commit 83dbd18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dashboard/src/scenes/action/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ const View = () => {
const statusChanged = body.status && action.status !== body.status;
if (statusChanged) {
if ([DONE, CANCEL].includes(body.status)) {
body.completedAt = now();
// When status changed to finished (done, cancel) completedAt we set it to now if not set.
body.completedAt = body.completedAt || now();
} else {
// When status just changed to "todo" we set completedAt to null (since it's not done yet).
body.completedAt = null;
}
}
Expand Down

0 comments on commit 83dbd18

Please sign in to comment.