Add ability to update multiple prompts at once

To Promptmanager
This commit is contained in:
maver 2023-06-01 18:51:30 +02:00
parent 9beefca3f5
commit ce7759e12f
1 changed files with 12 additions and 0 deletions

View File

@ -231,6 +231,18 @@ PromptManagerModule.prototype.updatePrompt = function (prompt) {
prompt.content = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt').value;
}
PromptManagerModule.prototype.updatePromptByIdentifier = function (identifier, updatePrompt) {
let prompt = this.serviceSettings.prompts.find((item) => identifier === item.identifier);
if (prompt) prompt = Object.assign(prompt, updatePrompt);
}
PromptManagerModule.prototype.updatePrompts = function (prompts) {
prompts.forEach((update) => {
let prompt = this.getPromptById(update.identifier);
if (prompt) Object.assign(prompt, update);
})
}
// Add a prompt to the current characters prompt list
PromptManagerModule.prototype.appendPrompt = function (prompt, character) {
const promptList = this.getPromptListByCharacter(character);