In groups with more than 2 participants, sent messages will appear as duplicates with the
same ownerPubKey
and created_at
values, but encrypted for a different index.
[
{ ownerPubKey: 'a' , nostrEvent: { created_at: 123456789 }},
{ ownerPubKey: 'a' , nostrEvent: { created_at: 123456789 }}
].filter(uniqueNotesBySenderAndDate)
https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
Array.filter
predicate that removes duplicate Notes with the same pubkey and created_at values.