on main help sign in
fix(spinner): fix animation not ticking sometimes
commitb2670133b890da55bf40af248600102fed32f744 authorAndrey Nering <andreynering@users.noreply.github.com> dateThu 10 Jul 2025, 17:56 (1 year ago) parent8a59cab
2 files changed+2−8
internal/tui/components/chat/messages/messages.go+1−4 internal/tui/components/chat/messages/tool.go+1−4
internal/tui/components/chat/messages/messages.go+1−4
@@ -66,10 +66,7 @@ func NewMessageCmp(msg message.Message) MessageCmp {
6666// Returns a command to start the animation for spinning messages.
6767func (m *messageCmp) Init() tea.Cmd {
6868 m.spinning = m.shouldSpin()
69− if m.spinning {
70− return m.anim.Init()
71− }
72− return nil
69+ return m.anim.Init()
7370}
7471
7572// 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
114114// Returns a command to start the animation for pending tool calls.
115115func (m *toolCallCmp) Init() tea.Cmd {
116116 m.spinning = m.shouldSpin()
117− if m.spinning {
118− return m.anim.Init()
119− }
120− return nil
117+ return m.anim.Init()
121118}
122119
123120// Update handles incoming messages and updates the component state.