diff --git a/ts/components/ConversationList.tsx b/ts/components/ConversationList.tsx index 01d0b1bb8a..3caa6e1453 100644 --- a/ts/components/ConversationList.tsx +++ b/ts/components/ConversationList.tsx @@ -318,14 +318,15 @@ export function ConversationList({ ); const renderRow: ListRowRenderer = useCallback( - ({ key, index, style }) => { + ({ key: providedKey, index, style }) => { const row = getRow(index); if (!row) { assertDev(false, `Expected a row at index ${index}`); - return
; + return ; } let result: ReactNode; + let key: string; switch (row.type) { case RowType.ArchiveButton: result = ( @@ -344,9 +345,11 @@ export function ConversationList({ ); + key = 'archive'; break; case RowType.Blank: result = undefined; + key = `blank:${providedKey}`; break; case RowType.Contact: { const { isClickable = true, hasContextMenu = false } = row; @@ -368,6 +371,7 @@ export function ConversationList({ onRemove={isClickable ? removeConversation : undefined} /> ); + key = `contact:${row.contact.id}`; break; } case RowType.ContactCheckbox: @@ -382,6 +386,7 @@ export function ConversationList({ theme={theme} /> ); + key = `contact-checkbox:${row.contact.id}`; break; case RowType.ClearFilterButton: result = ( @@ -400,6 +405,7 @@ export function ConversationList({ ); + key = 'clear-filter'; break; case RowType.PhoneNumberCheckbox: result = ( @@ -419,6 +425,7 @@ export function ConversationList({ theme={theme} /> ); + key = `phone-number-checkbox:${row.phoneNumber.e164}`; break; case RowType.UsernameCheckbox: result = ( @@ -438,6 +445,7 @@ export function ConversationList({ theme={theme} /> ); + key = `username-checkbox:${row.username}`; break; case RowType.GenericCheckbox: result = ( @@ -453,6 +461,7 @@ export function ConversationList({ clickable /> ); + key = `generic-checkbox:${providedKey}`; break; case RowType.Conversation: { const itemProps = pick(row.conversation, [ @@ -486,6 +495,7 @@ export function ConversationList({ 'serviceId', ]); const { badges, title, unreadCount, lastMessage } = itemProps; + key = `conversation:${itemProps.id}`; result = (