From fd356a35cb9de9df8923cb8ad5f0594b7de83e5c Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Thu, 9 Mar 2023 13:12:50 +0530 Subject: [PATCH] fixed contacts --- .../ConversationList/ConversationList.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/containers/Chat/ChatConversations/ConversationList/ConversationList.tsx b/src/containers/Chat/ChatConversations/ConversationList/ConversationList.tsx index d6a0740b6..71cb9dcca 100644 --- a/src/containers/Chat/ChatConversations/ConversationList/ConversationList.tsx +++ b/src/containers/Chat/ChatConversations/ConversationList/ConversationList.tsx @@ -89,22 +89,24 @@ export const ConversationList = ({ } }); - // reset offset value on saved search changes - useEffect(() => { - if (savedSearchCriteriaId) { - setLoadingOffset(DEFAULT_CONTACT_LIMIT + 10); - } - }, [savedSearchCriteriaId]); - const { loading: conversationLoading, error: conversationError, data, + refetch, } = useQuery(SEARCH_QUERY, { variables: queryVariables, fetchPolicy: 'cache-only', }); + // reset offset value on saved search changes + useEffect(() => { + if (savedSearchCriteriaId) { + setLoadingOffset(DEFAULT_CONTACT_LIMIT); + refetch(queryVariables); + } + }, [savedSearchCriteriaId]); + const filterVariables = () => { if (savedSearchCriteria && Object.keys(searchParam).length === 0) { const variables = JSON.parse(savedSearchCriteria);