diff --git a/src/app/features/settings/Profiles/PerMessageProfileEditor.tsx b/src/app/features/settings/Profiles/PerMessageProfileEditor.tsx index 63bccb18..0e609492 100644 --- a/src/app/features/settings/Profiles/PerMessageProfileEditor.tsx +++ b/src/app/features/settings/Profiles/PerMessageProfileEditor.tsx @@ -45,9 +45,18 @@ export function PerMessageProfileEditor({ const [currentId, setCurrentId] = useState(profileId); const [newId, setNewId] = useState(profileId); + console.warn(pronouns); + // Pronouns const [currentPronouns, setCurrentPronouns] = useState(pronouns); const [newPronouns, setNewPronouns] = useState(pronouns); + const currentPronounsString = useMemo( + () => + Array.isArray(currentPronouns) + ? currentPronouns.map((p) => `${p.language ? `${p.language}:` : ''}${p.summary}`).join(', ') + : '', + [currentPronouns] + ); const [newPronounsString, setNewPronounsString] = useState(() => { const pronounsString = Array.isArray(newPronouns) ? newPronouns.map((p) => `${p.language ? `${p.language}:` : ''}${p.summary}`).join(', ') @@ -98,10 +107,17 @@ export function PerMessageProfileEditor({ const hasChanges = useMemo( () => newDisplayName !== (currentDisplayName ?? '') || - newPronouns !== (currentPronouns ?? '') || + newPronounsString !== currentPronounsString || hasIdChange || !!imageFile, - [newDisplayName, currentDisplayName, newPronouns, currentPronouns, hasIdChange, imageFile] + [ + newDisplayName, + currentDisplayName, + newPronounsString, + currentPronounsString, + hasIdChange, + imageFile, + ] ); /** diff --git a/src/app/features/settings/Profiles/PerMessageProfileOverview.tsx b/src/app/features/settings/Profiles/PerMessageProfileOverview.tsx index f2e74e65..6ed0dcef 100644 --- a/src/app/features/settings/Profiles/PerMessageProfileOverview.tsx +++ b/src/app/features/settings/Profiles/PerMessageProfileOverview.tsx @@ -55,6 +55,7 @@ export function PerMessageProfileOverview() { profileId={profile.id} avatarMxcUrl={profile.avatarUrl} displayName={profile.name} + pronouns={profile.pronouns} onDelete={handleDelete} /> ))}