Uncaught RangeError: Maximum call stack size exceeded

Fix formatTime infinite loop #1621
This commit is contained in:
Binyamin Laukstein 2020-01-22 08:53:08 +02:00 committed by GitHub
parent b2ac730572
commit c3f10e7df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ export const getSeconds = value => Math.trunc(value % 60, 10);
export function formatTime(time = 0, displayHours = false, inverted = false) {
// Bail if the value isn't a number
if (!is.number(time)) {
return formatTime(null, displayHours, inverted);
return formatTime(undefined, displayHours, inverted);
}
// Format time component to add leading zero