Skip to content

Commit

Permalink
Fix zero-padding logic on minutes
Browse files Browse the repository at this point in the history
Fixes webtorrent#1438

The if statement was testing the opposite of the case it was supposed to test. Changing `>` to `<=` would fix the issue, but there's no reason to even have the conditional to begin with, since `zeroPad(2, 10) === '10'`
  • Loading branch information
BenMusch authored Jul 21, 2018
1 parent e0de30b commit 6bca187
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/renderer/pages/player-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,7 @@ function formatTime (time, total) {
let totalMinutes = Math.floor(total % 3600 / 60)
let hours = Math.floor(time / 3600)
let minutes = Math.floor(time % 3600 / 60)
if (totalMinutes > 9) {
minutes = zeroFill(2, minutes)
}
minutes = zeroFill(2, minutes)
let seconds = zeroFill(2, Math.floor(time % 60))

return (totalHours > 0 ? hours + ':' : '') + minutes + ':' + seconds
Expand Down

0 comments on commit 6bca187

Please sign in to comment.