one image attached

This commit is contained in:
Eason Goodale
2025-04-19 19:00:50 -07:00
parent d7d2c3f1e7
commit 2bcc15a839
4 changed files with 42 additions and 22 deletions

View File

@@ -468,8 +468,10 @@ export default function TerminalChatInput({
// Remove trailing '@' sentinel from draft input
setInput((prev) => (prev.endsWith("@") ? prev.slice(0, -1) : prev));
// Track attachment separately
setAttachedImages((prev) => [...prev, filePath]);
// Track attachment separately, but avoid duplicates
setAttachedImages((prev) =>
prev.includes(filePath) ? prev : [...prev, filePath],
);
if (process.env.DEBUG_TCI) {
// eslint-disable-next-line no-console