mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: don't delay messages behind a long command
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
3609d87e70
commit
cbe309d624
5
tea.go
5
tea.go
@@ -249,7 +249,10 @@ func (p *Program) handleCommands(cmds chan Cmd) chan struct{} {
|
||||
// (e.g. tick commands that sleep for half a second). It's not
|
||||
// possible to cancel them so we'll have to leak the goroutine
|
||||
// until Cmd returns.
|
||||
go p.Send(cmd())
|
||||
go func() {
|
||||
msg := cmd() // this can be long.
|
||||
p.Send(msg)
|
||||
}()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user