Skip to content

Commit

Permalink
fix: player duration display
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed Jul 29, 2024
1 parent ad97c3b commit 1b615f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/src/modules/feed-column/corner-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const CornerPlayerImpl = () => {
)
}

const ONE_HOUR_IN_SECONDS = 60 * 60
const PlayerProgress = () => {
const playerValue = usePlayerAtomValue()

Expand All @@ -215,11 +216,11 @@ const PlayerProgress = () => {
const currentTimeIndicator = dayjs()
.startOf("y")
.second(controlledCurrentTime)
.format("mm:ss")
.format(controlledCurrentTime > ONE_HOUR_IN_SECONDS ? "H:mm:ss" : "m:ss")
const remainingTimeIndicator = dayjs()
.startOf("y")
.second(duration - controlledCurrentTime)
.format("mm:ss")
.format(duration - controlledCurrentTime > ONE_HOUR_IN_SECONDS ? "H:mm:ss" : "m:ss")

return (
<div className="relative mt-2">
Expand Down

0 comments on commit 1b615f7

Please sign in to comment.