Merge pull request #18855 from ramonlsouza/add-reactions-userlist

fix: user reactions do not appear in userlist
This commit is contained in:
Ramón Souza 2023-09-27 08:44:30 -03:00 committed by GitHub
commit 5b196afb3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,10 @@ export interface Voice {
startTime: number; startTime: number;
} }
export interface Reaction {
reactionEmoji: string;
}
export interface User { export interface User {
userId: string; userId: string;
extId: string; extId: string;
@ -66,4 +70,5 @@ export interface User {
size: number; size: number;
away: boolean; away: boolean;
raiseHand: boolean; raiseHand: boolean;
reaction: Reaction;
} }

View File

@ -108,6 +108,8 @@ const UserListItem: React.FC<UserListItemProps> = ({ user, lockSettings }) => {
: <Icon iconName={normalizeEmojiName('away')} />; : <Icon iconName={normalizeEmojiName('away')} />;
} if (user.emoji !== 'none' && user.emoji !== 'notAway') { } if (user.emoji !== 'none' && user.emoji !== 'notAway') {
return <Icon iconName={normalizeEmojiName(user.emoji)} />; return <Icon iconName={normalizeEmojiName(user.emoji)} />;
} if (user.reaction && user.reaction.reactionEmoji !== 'none') {
return user.reaction.reactionEmoji;
} if (user.name && userAvatarFiltered.length === 0) { } if (user.name && userAvatarFiltered.length === 0) {
return user.name.toLowerCase().slice(0, 2); return user.name.toLowerCase().slice(0, 2);
} return ''; } return '';

View File

@ -53,6 +53,9 @@ export const USER_LIST_SUBSCRIPTION = gql`subscription Users($offset: Int!, $lim
shortName shortName
currentlyInRoom currentlyInRoom
} }
reaction {
reactionEmoji
}
} }
}`; }`;