Refactor file name update in Lora card

- Updated the setupFileNameEditing function to pass the new file name in the updates object when calling updateLoraCard.
- Removed the page reload after file name change to improve user experience.
- Enhanced the updateLoraCard function to handle the 'file_name' update, ensuring the dataset reflects the new file name correctly.
This commit is contained in:
Will Miao
2025-04-12 16:35:35 +08:00
parent 515aa1d2bd
commit 2fc06ae64e
3 changed files with 7 additions and 1739 deletions

View File

@@ -452,12 +452,8 @@ export function setupFileNameEditing(filePath) {
// Get the new file path and update the card
const newFilePath = filePath.replace(originalValue, newFileName);
updateLoraCard(filePath, {}, newFilePath);
// Reload the page after a short delay to reflect changes
setTimeout(() => {
window.location.reload();
}, 1500);
// Pass the new file_name in the updates object for proper card update
updateLoraCard(filePath, { file_name: newFileName }, newFilePath);
} else {
throw new Error(result.error || 'Unknown error');
}