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>
This commit is contained in:
Wolfsblvt
2026-04-13 23:19:02 +02:00
committed by GitHub
parent 737cb95adb
commit d72f4b6fcb
+10
View File
@@ -1827,6 +1827,16 @@ async function duplicatePersona(avatarId) {
};
await uploadUserAvatar(getUserAvatar(avatarId), newAvatarId);
const eventData = {
avatarId: newAvatarId,
name: personaName,
description: descriptor?.description ?? '',
title: descriptor?.title ?? '',
duplicatedFromAvatarId: avatarId,
};
await eventSource.emit(event_types.PERSONA_CREATED, eventData);
await getUserAvatars(true, newAvatarId);
saveSettingsDebounced();
}