Skip to content

Commit e8e0f72

Browse files
fix: undefined names field in reaction
1 parent d4793ff commit e8e0f72

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/containers/message/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@ class MessageContainer extends React.Component<IMessageContainerProps, IMessageC
241241
if (alreadyReacted) {
242242
// remove
243243
const currentReaction = updated[index];
244+
console.log(currentReaction)
244245
const newUsers = currentReaction.usernames.filter(u => u !== username);
245-
const newNames = currentReaction.names.filter((_, i) => currentReaction.usernames[i] !== username);
246+
const newNames = currentReaction.usernames.filter((_, i) => currentReaction.usernames[i] !== username);
246247

247248
if (newUsers.length === 0) {
248249
updated.splice(index, 1);
@@ -259,7 +260,7 @@ class MessageContainer extends React.Component<IMessageContainerProps, IMessageC
259260
updated[index] = {
260261
...currentReaction,
261262
usernames: [...currentReaction.usernames, username],
262-
names: [...currentReaction.names, username]
263+
names: [...currentReaction.usernames, username]
263264
};
264265
}
265266
} else {

0 commit comments

Comments
 (0)