forked from Mirrors/bubbletea
fix: don't delay messages behind a long command
This commit is contained in:
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)
|
||||
}()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue