on main help sign in
fix(spinner): fix animation not ticking sometimes
b267013Andrey Nering
internal/tui/components/chat/messages/messages.go+1−4
@@ -66,10 +66,7 @@ func NewMessageCmp(msg message.Message) MessageCmp {
66// Returns a command to start the animation for spinning messages.
66// Returns a command to start the animation for spinning messages.
67func (m *messageCmp) Init() tea.Cmd {
67func (m *messageCmp) Init() tea.Cmd {
68 m.spinning = m.shouldSpin()
68 m.spinning = m.shouldSpin()
69− if m.spinning {
70− return m.anim.Init()
69+ return m.anim.Init()
71− }
72− return nil
73}
70}
74
71
75// Update handles incoming messages and updates the component state.
72// Update handles incoming messages and updates the component state.
internal/tui/components/chat/messages/tool.go+1−4
@@ -114,10 +114,7 @@ func NewToolCallCmp(parentMessageID string, tc message.ToolCall, opts ...ToolCal
114// Returns a command to start the animation for pending tool calls.
114// Returns a command to start the animation for pending tool calls.
115func (m *toolCallCmp) Init() tea.Cmd {
115func (m *toolCallCmp) Init() tea.Cmd {
116 m.spinning = m.shouldSpin()
116 m.spinning = m.shouldSpin()
117− if m.spinning {
118− return m.anim.Init()
117+ return m.anim.Init()
119− }
120− return nil
121}
118}
122
119
123// Update handles incoming messages and updates the component state.
120// Update handles incoming messages and updates the component state.