mirror of https://github.com/waku-org/js-waku.git
Fix the key
The timestamp is seconds so you can easily have the same key if two participants send a message at the same time.
This commit is contained in:
parent
e0be69a056
commit
0969d073ac
|
@ -11,7 +11,8 @@ export default function ChatList(props: Props) {
|
|||
|
||||
const listItems = messages.map((currentMessage) => (
|
||||
<Message
|
||||
key={currentMessage.timestamp.toString()}
|
||||
// We assume that the same user is not sending two messages in the same second
|
||||
key={currentMessage.timestamp.toString() + currentMessage.nick}
|
||||
authorName={currentMessage.nick}
|
||||
date={formatDisplayDate(currentMessage)}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue