mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
protect default objective prompt, cleanup
This commit is contained in:
@ -429,6 +429,11 @@ function addCustomPrompt(customPromptName, customPrompts) {
|
|||||||
toastr.warning("Please set custom prompt name to save.")
|
toastr.warning("Please set custom prompt name to save.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (customPromptName == "default"){
|
||||||
|
toastr.error("Cannot save over default prompt")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
extension_settings.objective.customPrompts[customPromptName] = {}
|
||||||
Object.assign(extension_settings.objective.customPrompts[customPromptName], customPrompts)
|
Object.assign(extension_settings.objective.customPrompts[customPromptName], customPrompts)
|
||||||
saveSettingsDebounced()
|
saveSettingsDebounced()
|
||||||
populateCustomPrompts()
|
populateCustomPrompts()
|
||||||
@ -502,7 +507,6 @@ function loadSettings() {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
checkCounter = chat_metadata['objective'].checkFrequency
|
checkCounter = chat_metadata['objective'].checkFrequency
|
||||||
objectivePrompts = chat_metadata['objective'].prompts
|
|
||||||
|
|
||||||
// Update UI elements
|
// Update UI elements
|
||||||
$('#objective-counter').text(checkCounter)
|
$('#objective-counter').text(checkCounter)
|
||||||
|
Reference in New Issue
Block a user