fix: elapsed time continues ticking whilst paused/not playing
Fixes: https://github.com/acaloiaro/di-tui/issues/39
This commit is contained in:
parent
504b46e6f5
commit
3e1aa36090
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
|
@ -163,6 +163,10 @@ func configureEventHandling() {
|
|||
go func() {
|
||||
c := time.Tick(1 * time.Second)
|
||||
for range c {
|
||||
// don't show elapsed time updates when playback is paused/not playing
|
||||
if !ctx.IsPlaying {
|
||||
continue
|
||||
}
|
||||
elapsed := time.Since(ctx.View.NowPlaying.Track.StartTime)
|
||||
|
||||
// If the current time is past the end of the track, then a new track is playing and the now playing track needs
|
||||
|
|
|
|||
Loading…
Reference in a new issue