Close and clear popup on preset change

This commit is contained in:
maver 2023-08-01 18:21:27 +02:00
parent db8624cefe
commit fd10eaf037
2 changed files with 7 additions and 1 deletions

View File

@ -161,7 +161,7 @@ import { context_settings, loadContextTemplatesFromSettings } from "./scripts/co
import { markdownExclusionExt } from "./scripts/showdown-exclusion.js";
import { NOTE_MODULE_NAME, metadata_keys, setFloatingPrompt, shouldWIAddPrompt } from "./scripts/authors-note.js";
import { deviceInfo } from "./scripts/RossAscends-mods.js";
import {registerPromptManagerMigration} from "./scripts/PromptManager.js";
import { registerPromptManagerMigration } from "./scripts/PromptManager.js";
import { getRegexedString, regex_placement } from "./scripts/extensions/regex/engine.js";
//exporting functions and vars for mods

View File

@ -553,6 +553,12 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
// Re-render prompt manager on openai preset change
eventSource.on(event_types.OAI_PRESET_CHANGED, settings => this.render());
// Close popup on preset change
eventSource.on(event_types.OAI_PRESET_CHANGED, () => {
this.hidePopup();
this.clearEditForm();
});
// Re-render prompt manager on world settings update
eventSource.on(event_types.WORLDINFO_SETTINGS_UPDATED, () => this.render());