mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +00:00
fix(cursor): fix data race on blinkTag (#784)
This commit is contained in:
+3
-1
@@ -173,11 +173,13 @@ func (m *Model) BlinkCmd() tea.Cmd {
|
||||
|
||||
m.blinkTag++
|
||||
|
||||
blinkMsg := BlinkMsg{id: m.id, tag: m.blinkTag}
|
||||
|
||||
return func() tea.Msg {
|
||||
defer cancel()
|
||||
<-ctx.Done()
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
return BlinkMsg{id: m.id, tag: m.blinkTag}
|
||||
return blinkMsg
|
||||
}
|
||||
return blinkCanceled{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user