chore: update typing indicator to at least use display name

This commit is contained in:
Paul Makles 2023-06-12 09:52:00 +01:00
parent fead4ca879
commit 9b9ec867da
No known key found for this signature in database
GPG key ID: 5059F398521BB0F6

View file

@ -76,7 +76,9 @@ export default observer(({ channel }: Props) => {
if (users.length >= 5) { if (users.length >= 5) {
text = <Text id="app.main.channel.typing.several" />; text = <Text id="app.main.channel.typing.several" />;
} else if (users.length > 1) { } else if (users.length > 1) {
const userlist = [...users].map((x) => x!.username); const userlist = [...users].map(
(x) => x!.display_name ?? x!.username,
);
const user = userlist.pop(); const user = userlist.pop();
text = ( text = (
@ -92,7 +94,9 @@ export default observer(({ channel }: Props) => {
text = ( text = (
<Text <Text
id="app.main.channel.typing.single" id="app.main.channel.typing.single"
fields={{ user: users[0]!.username }} fields={{
user: users[0]!.display_name ?? users[0]!.username,
}}
/> />
); );
} }