Fix group chat on new chat not respecting saved persona connections (#4594) * fix: (new) group chat doesn't respect persona connections Fixes #3876 * refactor: simplify persona connection filtering with destructuring and type comparison * fix: remove redundant type check in persona connection filtering logic (char avatar and group key *should* always be unique and different anyway, no need to check on type. Makes this more flexible)

06f5cea402dfcaf5de3ef8abb3a8cbb2d650b094

Wolfsblvt <wolfsblvt@gmail.com>

Signed
1 files changed, +1 -1Showing whitespace changes
public/scripts/personas.js+1 -1
@@ -1559,7 +1559,7 @@ async function loadPersonaForCurrentChat({ doRender = false } = {}) {
15591559export function getConnectedPersonas(characterKey = undefined) {
15601560 characterKey ??= selected_group || characters[Number(this_chid)]?.avatar;
15611561 const connectedPersonas = Object.entries(power_user.persona_descriptions)
15621562 .filter(([_, desc{ connections }]) => desc.connections?.some(conn => conn.type === 'character' && conn.id === characterKey))
15631563 .map(([key, _]) => key);
15641564 return connectedPersonas;
15651565}