mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Update prompt manager active character on character edit.
This commit is contained in:
@ -356,6 +356,11 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
|
||||
this.saveServiceSettings().then(() => this.render());
|
||||
});
|
||||
|
||||
eventSource.on(event_types.CHARACTER_EDITED, (event) => {
|
||||
this.handleCharacterUpdated(event);
|
||||
this.saveServiceSettings().then(() => this.render());
|
||||
})
|
||||
|
||||
// Re-render when the group changes.
|
||||
eventSource.on('groupSelected', (event) => {
|
||||
this.handleGroupSelected(event)
|
||||
@ -641,6 +646,12 @@ PromptManagerModule.prototype.handleCharacterSelected = function (event) {
|
||||
if (0 === promptList.length) this.addPromptListForCharacter(this.activeCharacter, openAiDefaultPromptList);
|
||||
}
|
||||
|
||||
PromptManagerModule.prototype.handleCharacterUpdated = function (event) {
|
||||
console.log(event)
|
||||
this.activeCharacter = {id: event.detail.id, ...event.detail.character};
|
||||
console.log(this.activeCharacter);
|
||||
}
|
||||
|
||||
PromptManagerModule.prototype.handleGroupSelected = function (event) {
|
||||
const characterDummy = {id: event.detail.id, group: event.detail.group};
|
||||
this.activeCharacter = characterDummy;
|
||||
|
Reference in New Issue
Block a user