Skip to content

Commit 3c1a12c

Browse files
authored
Merge pull request #91 from GCWing/gcwing/dev
fix: resolve currentImageCount TDZ error in ChatInput
2 parents cc8981c + 9055d70 commit 3c1a12c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/web-ui/src/flow_chat/components/ChatInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export const ChatInput: React.FC<ChatInputProps> = ({
6262
const addContext = useContextStore(state => state.addContext);
6363
const removeContext = useContextStore(state => state.removeContext);
6464
const clearContexts = useContextStore(state => state.clearContexts);
65+
66+
const currentImageCount = useMemo(
67+
() => contexts.filter(c => c.type === 'image').length,
68+
[contexts],
69+
);
6570

6671
const activeSessionState = useActiveSessionState();
6772
const currentSessionId = activeSessionState.sessionId;
@@ -753,11 +758,6 @@ export const ChatInput: React.FC<ChatInputProps> = ({
753758
transition(SessionExecutionEvent.USER_CANCEL);
754759
}
755760
}, [handleSendOrCancel, derivedState, transition, templateState.fillState, moveToNextPlaceholder, moveToPrevPlaceholder, exitTemplateMode, slashCommandState, getFilteredModes, selectSlashCommandMode, canSwitchModes]);
756-
757-
const currentImageCount = useMemo(
758-
() => contexts.filter(c => c.type === 'image').length,
759-
[contexts],
760-
);
761761

762762
const handleImageInput = useCallback(() => {
763763
const remaining = CHAT_INPUT_CONFIG.image.maxCount - currentImageCount;

0 commit comments

Comments
 (0)