Skip to content

Commit 52fc32e

Browse files
authored
Disable followup clicks after freebuff session ends (#531)
1 parent 6430edb commit 52fc32e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cli/src/components/tools/suggest-followups.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { defineToolComponent } from './types'
55
import { useTerminalDimensions } from '../../hooks/use-terminal-dimensions'
66
import { useTheme } from '../../hooks/use-theme'
77
import { getLatestFollowupToolCallId, useChatStore } from '../../state/chat-store'
8+
import { useFreebuffSessionStore } from '../../state/freebuff-session-store'
9+
import { IS_FREEBUFF } from '../../utils/constants'
810
import { Button } from '../button'
911

1012
import type { ToolRenderConfig } from './types'
@@ -223,6 +225,9 @@ const SuggestFollowupsItem = ({
223225
}: SuggestFollowupsItemProps) => {
224226
const theme = useTheme()
225227
const inputFocused = useChatStore((state) => state.inputFocused)
228+
const isFreebuffSessionOver = useFreebuffSessionStore(
229+
(state) => IS_FREEBUFF && state.session?.status === 'ended',
230+
)
226231
const setSuggestedFollowups = useChatStore(
227232
(state) => state.setSuggestedFollowups,
228233
)
@@ -305,7 +310,7 @@ const SuggestFollowupsItem = ({
305310
isHovered={hoveredIndex === index}
306311
onSendFollowup={onSendFollowup}
307312
onHover={setHoveredIndex}
308-
disabled={!inputFocused}
313+
disabled={!inputFocused || isFreebuffSessionOver}
309314
labelColumnWidth={labelColumnWidth}
310315
/>
311316
))}

0 commit comments

Comments
 (0)