mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-15 20:26:33 +01:00
chore: clean up comments and remove debugging log statements
This commit is contained in:
parent
441e69181c
commit
58678be0f8
1 changed files with 0 additions and 20 deletions
|
|
@ -190,7 +190,6 @@ const PromptForm = () => {
|
||||||
const [showSidePanel, setShowSidePanel] = useState(false);
|
const [showSidePanel, setShowSidePanel] = useState(false);
|
||||||
const sidePanelWidth = '320px';
|
const sidePanelWidth = '320px';
|
||||||
|
|
||||||
// Initialize prompt file handling
|
|
||||||
const {
|
const {
|
||||||
loadFromToolResources,
|
loadFromToolResources,
|
||||||
getToolResources,
|
getToolResources,
|
||||||
|
|
@ -199,16 +198,8 @@ const PromptForm = () => {
|
||||||
setFiles,
|
setFiles,
|
||||||
} = usePromptFileHandling({
|
} = usePromptFileHandling({
|
||||||
onFileChange: (updatedFiles) => {
|
onFileChange: (updatedFiles) => {
|
||||||
// Auto-save when files are added/removed
|
|
||||||
console.log('onFileChange called', {
|
|
||||||
canEdit,
|
|
||||||
selectedPrompt: !!selectedPrompt,
|
|
||||||
updatedFiles,
|
|
||||||
});
|
|
||||||
if (canEdit && selectedPrompt) {
|
if (canEdit && selectedPrompt) {
|
||||||
const currentPromptText = getValues('prompt');
|
const currentPromptText = getValues('prompt');
|
||||||
console.log('Calling onSave with:', currentPromptText, 'and updated files:', updatedFiles);
|
|
||||||
// Call onSave with the updated files to ensure correct tool_resources
|
|
||||||
onSave(currentPromptText, updatedFiles);
|
onSave(currentPromptText, updatedFiles);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -328,7 +319,6 @@ const PromptForm = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use updated files if provided, otherwise use current hook state
|
|
||||||
const toolResources = updatedFiles
|
const toolResources = updatedFiles
|
||||||
? getToolResourcesFromFiles(updatedFiles)
|
? getToolResourcesFromFiles(updatedFiles)
|
||||||
: getToolResources();
|
: getToolResources();
|
||||||
|
|
@ -341,24 +331,14 @@ const PromptForm = () => {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if prompt text or tool_resources have changed
|
|
||||||
const promptTextChanged = value !== selectedPrompt.prompt;
|
const promptTextChanged = value !== selectedPrompt.prompt;
|
||||||
const toolResourcesChanged =
|
const toolResourcesChanged =
|
||||||
JSON.stringify(toolResources) !== JSON.stringify(selectedPrompt.tool_resources);
|
JSON.stringify(toolResources) !== JSON.stringify(selectedPrompt.tool_resources);
|
||||||
|
|
||||||
console.log('onSave check:', {
|
|
||||||
promptTextChanged,
|
|
||||||
toolResourcesChanged,
|
|
||||||
currentToolResources: toolResources,
|
|
||||||
selectedToolResources: selectedPrompt.tool_resources,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!promptTextChanged && !toolResourcesChanged) {
|
if (!promptTextChanged && !toolResourcesChanged) {
|
||||||
console.log('No changes detected, returning early');
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're adding to an existing group, so use the addPromptToGroup mutation
|
|
||||||
addPromptToGroupMutation.mutate({ ...tempPrompt, groupId });
|
addPromptToGroupMutation.mutate({ ...tempPrompt, groupId });
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue