Add PERSONA_CHANGED event (#5218) * Initial plan * Add PERSONA_CHANGED event emission when active user avatar changes Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Cohee1207 <18619528+Cohee1207@users.noreply.github.com>

ccf8ce7a06b507124b96d53d4c5e7250a3db0ebd

Copilot <198982749+Copilot@users.noreply.github.com>

Signed
2 files changed, +2 -0Showing whitespace changes
public/scripts/events.js+1 -0
@@ -96,6 +96,7 @@ export const event_types = {
9696 WORLDINFO_ENTRIES_LOADED: 'worldinfo_entries_loaded',
9797 WORLDINFO_SCAN_DONE: 'worldinfo_scan_done',
9898 MEDIA_ATTACHMENT_DELETED: 'media_attachment_deleted',
99+ PERSONA_CHANGED: 'persona_changed',
99100};
100101
101102export const eventSource = new EventEmitter([event_types.APP_READY, event_types.APP_INITIALIZED]);
public/scripts/personas.js+1 -0
@@ -124,6 +124,7 @@ export async function setUserAvatar(imgfile, { toastPersonaNameChange = true, na
124124 await retriggerFirstMessageOnEmptyChat();
125125 saveSettingsDebounced();
126126 $('.zoomed_avatar[forchar]').remove();
127+ await eventSource.emit(event_types.PERSONA_CHANGED, user_avatar);
127128}
128129
129130function reloadUserAvatar(force = false) {