mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-17 14:57:19 +00:00
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) => (
|
const listItems = messages.map((currentMessage) => (
|
||||||
<Message
|
<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}
|
authorName={currentMessage.nick}
|
||||||
date={formatDisplayDate(currentMessage)}
|
date={formatDisplayDate(currentMessage)}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user