The issue is utils.ts in secondsToMMSS care of wonderful floating point math. Like the number coming in is something like 59.8 seconds, which is less than 60 so
Math.ceil(seconds % 60)
Since we're modding a floating point, seconds % 60 can yield 0 through 59.999..., so running Math.ceil is bringing it up to 60.
Probably best to run ceiling on the initial seconds before calculating minutes and then use round instead of ceil for calculating secondsForFormatting.
That will also fix the fact that the minute went down to 0 before reaching 59 seconds.
This picture says it all:
The issue is utils.ts in secondsToMMSS care of wonderful floating point math. Like the number coming in is something like 59.8 seconds, which is less than 60 so Math.ceil(seconds % 60) Since we're modding a floating point, seconds % 60 can yield 0 through 59.999..., so running Math.ceil is bringing it up to 60.
Probably best to run ceiling on the initial seconds before calculating minutes and then use round instead of ceil for calculating secondsForFormatting.
That will also fix the fact that the minute went down to 0 before reaching 59 seconds.