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