From 4ae0950dd22991c518a0aa8ff8bd07c813385c38 Mon Sep 17 00:00:00 2001 From: Amir Ghezelbash Date: Wed, 18 Dec 2024 19:58:22 +0300 Subject: [PATCH] clean --- .../LeftSidebar/panels/Conversations/ConversationsList.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx index 616e5cdd50c..361f9182810 100644 --- a/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx +++ b/src/script/page/LeftSidebar/panels/Conversations/ConversationsList.tsx @@ -24,6 +24,7 @@ import React, { useState, MutableRefObject, useCallback, + useRef, } from 'react'; import {useVirtualizer} from '@tanstack/react-virtual'; @@ -173,10 +174,8 @@ export const ConversationsList = ({ (isFolderView && currentFolder?.conversations().filter(conversationSearchFilter(conversationsFilter))) || []; const conversationsToDisplay = filteredConversations.length ? filteredConversations : conversations; - // The scrollable element for your list - const parentRef = React.useRef(null); + const parentRef = useRef(null); - // The virtualizer const rowVirtualizer = useVirtualizer({ count: conversationsToDisplay.length, getScrollElement: () => parentRef.current,