Skip to content

Commit 6ec388f

Browse files
committed
Fix: Prevent negative time in Spotify display
Ensure the displayed time for Spotify tracks does not go below zero, which could occur if `currentTime` is slightly less than `status.spotify.timestamps.start` due to timing issues.
1 parent 9169122 commit 6ec388f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/DiscordStatus.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const LanyardStatus = () => {
9393
00:00
9494
</span>
9595
<span className="absolute inset-0">
96-
{formatTime(Math.min(currentTime - status.spotify.timestamps.start, status.spotify.timestamps.end - status.spotify.timestamps.start))}
96+
{formatTime(Math.max(0, Math.min(currentTime - status.spotify.timestamps.start, status.spotify.timestamps.end - status.spotify.timestamps.start)))}
9797
</span>
9898
</span>
9999

0 commit comments

Comments
 (0)