Emit `PERSONA_CREATED` event on persona duplication (#5448) * feat: emit PERSONA_CREATED event when duplicating a persona Adds PERSONA_CREATED event emission in duplicatePersona() to notify listeners when a persona is duplicated. Includes the new avatarId, name, and duplicatedFromAvatarId in the event payload. * fix: event data and execution order --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>

d72f4b6fcb3905a8f83cf60a0d9b657ceaaf669a

Wolfsblvt <wolfsblvt@gmail.com>

Signed
1 files changed, +10 -0Ignore whitespace
public/scripts/personas.js+10 -0
@@ -1827,6 +1827,16 @@ async function duplicatePersona(avatarId) {
1827 };1827 };
18281828
1829 await uploadUserAvatar(getUserAvatar(avatarId), newAvatarId);1829 await uploadUserAvatar(getUserAvatar(avatarId), newAvatarId);
1830
1831 const eventData = {
1832 avatarId: newAvatarId,
1833 name: personaName,
1834 description: descriptor?.description ?? '',
1835 title: descriptor?.title ?? '',
1836 duplicatedFromAvatarId: avatarId,
1837 };
1838 await eventSource.emit(event_types.PERSONA_CREATED, eventData);
1839
1830 await getUserAvatars(true, newAvatarId);1840 await getUserAvatars(true, newAvatarId);
1831 saveSettingsDebounced();1841 saveSettingsDebounced();
1832}1842}