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)
This commit is contained in:
Wolfsblvt
2025-10-04 13:24:49 +03:00
committed by GitHub
parent 334a5409a0
commit 06f5cea402
+1 -1
View File
@@ -1559,7 +1559,7 @@ async function loadPersonaForCurrentChat({ doRender = false } = {}) {
export function getConnectedPersonas(characterKey = undefined) {
characterKey ??= selected_group || characters[Number(this_chid)]?.avatar;
const connectedPersonas = Object.entries(power_user.persona_descriptions)
.filter(([_, desc]) => desc.connections?.some(conn => conn.type === 'character' && conn.id === characterKey))
.filter(([_, { connections }]) => connections?.some(conn => conn.id === characterKey))
.map(([key, _]) => key);
return connectedPersonas;
}