mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 04:37:40 +01:00
Use saveSettings function instead of saveSettingsDebounced
This commit is contained in:
parent
1048413a1a
commit
bc041d8fb3
@ -85,8 +85,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
|
|
||||||
this.handleAdvancedSettingsToggle = () => {
|
this.handleAdvancedSettingsToggle = () => {
|
||||||
this.serviceSettings.prompt_manager_settings.showAdvancedSettings = !this.serviceSettings.prompt_manager_settings.showAdvancedSettings
|
this.serviceSettings.prompt_manager_settings.showAdvancedSettings = !this.serviceSettings.prompt_manager_settings.showAdvancedSettings
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable and disable prompts
|
// Enable and disable prompts
|
||||||
@ -95,8 +94,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
const promptListEntry = this.getPromptListEntry(this.activeCharacter, promptID);
|
const promptListEntry = this.getPromptListEntry(this.activeCharacter, promptID);
|
||||||
|
|
||||||
promptListEntry.enabled = !promptListEntry.enabled;
|
promptListEntry.enabled = !promptListEntry.enabled;
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.render();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Open edit form and load selected prompt
|
// Open edit form and load selected prompt
|
||||||
@ -118,8 +116,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
this.detachPrompt(prompt, this.activeCharacter);
|
this.detachPrompt(prompt, this.activeCharacter);
|
||||||
this.hideEditForm();
|
this.hideEditForm();
|
||||||
this.clearEditForm();
|
this.clearEditForm();
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.render();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save prompt edit form to settings and close form.
|
// Save prompt edit form to settings and close form.
|
||||||
@ -130,10 +127,9 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
if (null === prompt) this.addPrompt(prompt, promptId);
|
if (null === prompt) this.addPrompt(prompt, promptId);
|
||||||
else this.updatePrompt(prompt);
|
else this.updatePrompt(prompt);
|
||||||
|
|
||||||
this.clearEditForm(prompt);
|
|
||||||
this.saveServiceSettings();
|
|
||||||
this.hideEditForm();
|
this.hideEditForm();
|
||||||
this.render();
|
this.clearEditForm(prompt);
|
||||||
|
this.saveServiceSettings().then(() => this.render());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handleAppendPrompt = (event) => {
|
this.handleAppendPrompt = (event) => {
|
||||||
@ -141,9 +137,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
const prompt = this.getPromptById(promptID);
|
const prompt = this.getPromptById(promptID);
|
||||||
|
|
||||||
this.appendPrompt(prompt, this.activeCharacter);
|
this.appendPrompt(prompt, this.activeCharacter);
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.saveServiceSettings()
|
|
||||||
this.render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete selected prompt from list form and close edit form
|
// Delete selected prompt from list form and close edit form
|
||||||
@ -156,8 +150,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
this.serviceSettings.prompts.splice(Number(promptIndex), 1);
|
this.serviceSettings.prompts.splice(Number(promptIndex), 1);
|
||||||
this.hideEditForm();
|
this.hideEditForm();
|
||||||
this.clearEditForm();
|
this.clearEditForm();
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.render();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -177,8 +170,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
|||||||
// Re-render when the character changes.
|
// Re-render when the character changes.
|
||||||
document.addEventListener('characterSelected', (event) => {
|
document.addEventListener('characterSelected', (event) => {
|
||||||
this.handleCharacterSelected(event)
|
this.handleCharacterSelected(event)
|
||||||
this.saveServiceSettings();
|
this.saveServiceSettings().then(() => this.render());
|
||||||
this.render();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Prepare prompt edit form save and close button.
|
// Prepare prompt edit form save and close button.
|
||||||
|
@ -20,6 +20,7 @@ import {
|
|||||||
system_message_types,
|
system_message_types,
|
||||||
replaceBiasMarkup,
|
replaceBiasMarkup,
|
||||||
is_send_press,
|
is_send_press,
|
||||||
|
saveSettings,
|
||||||
main_api,
|
main_api,
|
||||||
} from "../script.js";
|
} from "../script.js";
|
||||||
import {groups, selected_group} from "./group-chats.js";
|
import {groups, selected_group} from "./group-chats.js";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user