Skip to content

Commit

Permalink
fixed contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshamoon committed Mar 9, 2023
1 parent e32b761 commit fd356a3
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>(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);
Expand Down

0 comments on commit fd356a3

Please sign in to comment.