fix updateAuthorList (#1276)

This commit is contained in:
Meisam
2021-07-28 01:55:19 +02:00
committed by GitHub
parent 41cfe33b8d
commit 2ff9186ee2

View File

@@ -276,9 +276,9 @@ export default class Chat extends Component {
nameList.push(message.user.displayName); nameList.push(message.user.displayName);
return nameList; return nameList;
} else if (type === SOCKET_MESSAGE_TYPES.NAME_CHANGE) { } else if (type === SOCKET_MESSAGE_TYPES.NAME_CHANGE) {
const { oldName, newName } = message; const { oldName, user } = message;
const oldNameIndex = nameList.indexOf(oldName); const oldNameIndex = nameList.indexOf(oldName);
nameList.splice(oldNameIndex, 1, newName); nameList.splice(oldNameIndex, 1, user.displayName);
return nameList; return nameList;
} }
return []; return [];