fixed pronouns error
This commit is contained in:
2 files changed
+19
-2
No files matched your search
@@ -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<PronounSet[]>(pronouns);
|
||||
const [newPronouns, setNewPronouns] = useState<PronounSet[]>(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,
|
||||
]
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,6 +55,7 @@ export function PerMessageProfileOverview() {
|
||||
profileId={profile.id}
|
||||
avatarMxcUrl={profile.avatarUrl}
|
||||
displayName={profile.name}
|
||||
pronouns={profile.pronouns}
|
||||
onDelete={handleDelete}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user