fix: append the attachment path to the existing text in the input prompt (#1842)
This commit is contained in:
@@ -144,7 +144,11 @@ export default function Input({
|
|||||||
const handleFileSelect = async () => {
|
const handleFileSelect = async () => {
|
||||||
const path = await window.electron.selectFileOrDirectory();
|
const path = await window.electron.selectFileOrDirectory();
|
||||||
if (path) {
|
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();
|
textAreaRef.current?.focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user