From d56aa0d1474d3a2053f5cf0ce54467bf0174bba5 Mon Sep 17 00:00:00 2001 From: Stian Aune Date: Wed, 20 Nov 2019 19:44:36 +0100 Subject: [PATCH] Fix differ. --- my-bois/src/helpers/diff.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/my-bois/src/helpers/diff.js b/my-bois/src/helpers/diff.js index 3575312..3a1470d 100644 --- a/my-bois/src/helpers/diff.js +++ b/my-bois/src/helpers/diff.js @@ -3,6 +3,10 @@ export function diffString(diff) { } export default function calculateDiff({program, cooldownMin = null, minutes, seconds, calories}) { + if (cooldownMin < 0) { + cooldownMin = null + } + const {warmupMin, warmupCpm, cpm, cooldownCpm} = program; const actualWarmup = cooldownMin !== null && cooldownMin > 0 ? Math.min(warmupMin, cooldownMin)