Skip to content

Commit

Permalink
fix(timeRemaining): use Math.max instead of condition
Browse files Browse the repository at this point in the history
  • Loading branch information
behnammodi committed Apr 4, 2021
1 parent 18e7d00 commit 52e2255
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
timeRemaining: function(){
var timeRemaining = remainingTime - (Date.now() - taskStart);
return timeRemaining < 0 ? 0 : timeRemaining;
return Math.max(0, timeRemaining)
},
};
var setInactive = debounce(function(){
Expand Down

0 comments on commit 52e2255

Please sign in to comment.