fix: append the attachment path to the existing text in the input prompt (#1842)

This commit is contained in:
Zaki Ali
2025-03-25 11:11:27 -07:00
committed by GitHub
parent a166649c73
commit 6d67e7c39a

View File

@@ -144,7 +144,11 @@ export default function Input({
const handleFileSelect = async () => {
const path = await window.electron.selectFileOrDirectory();
if (path) {
setValue(path);
// Append the path to existing text, with a space if there's existing text
setValue((prev) => {
const currentText = prev.trim();
return currentText ? `${currentText} ${path}` : path;
});
textAreaRef.current?.focus();
}
};