Persist settings before applying preset

This commit is contained in:
maver 2023-08-14 23:36:06 +02:00
parent 61b645f5ff
commit 8f830a0928
1 changed files with 7 additions and 6 deletions

View File

@ -571,12 +571,13 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_close_button').addEventListener('click', closeAndClearPopup); document.getElementById(this.configuration.prefix + 'prompt_manager_popup_close_button').addEventListener('click', closeAndClearPopup);
// Re-render prompt manager on openai preset change // Re-render prompt manager on openai preset change
eventSource.on(event_types.OAI_PRESET_CHANGED, settings => this.renderDebounced()); eventSource.on(event_types.OAI_PRESET_CHANGED, settings => {
// Save configuration and wrap everything up.
// Close popup on preset change this.saveServiceSettings().then(() => {
eventSource.on(event_types.OAI_PRESET_CHANGED, () => { this.hidePopup();
this.hidePopup(); this.clearEditForm();
this.clearEditForm(); this.renderDebounced()
});
}); });
// Re-render prompt manager on world settings update // Re-render prompt manager on world settings update