|
@ -3,6 +3,10 @@ export function diffString(diff) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default function calculateDiff({program, cooldownMin = null, minutes, seconds, calories}) { |
|
|
export default function calculateDiff({program, cooldownMin = null, minutes, seconds, calories}) { |
|
|
|
|
|
if (cooldownMin < 0) { |
|
|
|
|
|
cooldownMin = null |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const {warmupMin, warmupCpm, cpm, cooldownCpm} = program; |
|
|
const {warmupMin, warmupCpm, cpm, cooldownCpm} = program; |
|
|
const actualWarmup = cooldownMin !== null && cooldownMin > 0 |
|
|
const actualWarmup = cooldownMin !== null && cooldownMin > 0 |
|
|
? Math.min(warmupMin, cooldownMin) |
|
|
? Math.min(warmupMin, cooldownMin) |
|
|