From e3b97121d9a4e1d9ef4a15e32e064b48d929a5e8 Mon Sep 17 00:00:00 2001 From: Alexander Jung Date: Thu, 23 Nov 2023 14:23:13 +0100 Subject: [PATCH] fix(paraprogress): Do not quit on receiving 100% progress This may pre-emptively shutdown the process. Instead, let the process exit "naturally". If the process is reporting via the onProgress-callback 100%, then this a mistake of the use of the callback itself, and the user will simply have to wait beyond the 100% until the process exits. There is now also a `WithTimeout` option so we can have both graceful and non- graceful exits with this package. Signed-off-by: Alexander Jung --- tui/paraprogress/process.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tui/paraprogress/process.go b/tui/paraprogress/process.go index a7c8469b0..d99046a76 100644 --- a/tui/paraprogress/process.go +++ b/tui/paraprogress/process.go @@ -206,11 +206,6 @@ func (d *Process) Update(msg tea.Msg) (*Process, tea.Cmd) { return d, nil } - if msg.progress > 1.0 { - msg.progress = 1.0 - cmds = append(cmds, d.timer.Stop()) - } - d.percent = msg.progress // TickMsg is sent when the spinner wants to animate itself