refactor: remove unnecessary onFileChange, just handle onSave stuff in onFilesChange

This commit is contained in:
Dustin Healy 2025-09-07 01:59:53 -07:00
parent 384d6c870b
commit 2c1d7a6b71
5 changed files with 5 additions and 19 deletions

View file

@ -541,15 +541,15 @@ const PromptForm = () => {
<PromptVariablesAndFiles
promptText={promptText}
files={hookPromptFiles}
onFilesChange={setFiles}
handleFileChange={handleFileChange}
disabled={!canEdit}
onFileChange={(updatedFiles) => {
onFilesChange={(files) => {
setFiles(files);
if (canEdit && selectedPrompt) {
const currentPromptText = getValues('prompt');
onSave(currentPromptText, updatedFiles);
onSave(currentPromptText, files);
}
}}
handleFileChange={handleFileChange}
disabled={!canEdit}
/>
<Description
initialValue={group.oneliner ?? ''}