mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
fix: renderer only stops once
Ensure the tea renderer can be stopped and restarted more than once.
This commit is contained in:
@@ -73,7 +73,12 @@ func (r *standardRenderer) start() {
|
||||
if r.ticker == nil {
|
||||
r.ticker = time.NewTicker(r.framerate)
|
||||
}
|
||||
|
||||
// Since the renderer can be restarted after a stop, we need to reset
|
||||
// the done channel and its corresponding sync.Once.
|
||||
r.once = sync.Once{}
|
||||
r.done = make(chan struct{})
|
||||
|
||||
go r.listen()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user