From fdd0d575084564e1a1334873c092bf8dd46f1aad Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Thu, 23 May 2024 23:01:52 -0500 Subject: [PATCH] fix(player): Fix speed changes not taking effect until the next frame --- internal/player/player.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/player/player.go b/internal/player/player.go index d870b401..6d1381d3 100644 --- a/internal/player/player.go +++ b/internal/player/player.go @@ -202,10 +202,8 @@ func (p *Player) Update(msg tea.Msg) (tea.Model, tea.Cmd) { p.activeOption = 6 p.speed = 15 } - if !p.isPlaying() { - return p, p.play() - } - return p, nil + p.pause() + return p, p.play() case tea.MouseMsg: if msg.Action == tea.MouseActionRelease || msg.Button != tea.MouseButtonLeft { return p, nil