diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailThreads.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailThreads.tsx index 816b63219b..879bda9697 100644 --- a/packages/twenty-front/src/modules/activities/emails/components/EmailThreads.tsx +++ b/packages/twenty-front/src/modules/activities/emails/components/EmailThreads.tsx @@ -75,12 +75,21 @@ export const EmailThreads = ({ pageSize: TIMELINE_THREADS_DEFAULT_PAGE_SIZE, } as GetTimelineThreadsFromPersonIdQueryVariables; - const { data, loading, fetchMore, error } = useQuery(threadQuery, { + const { + data, + loading: firstQueryLoading, + fetchMore, + error, + } = useQuery(threadQuery, { variables: threadQueryVariables, }); const fetchMoreRecords = async () => { - if (emailThreadsPage.hasNextPage && !isFetchingMoreEmails) { + if ( + emailThreadsPage.hasNextPage && + !isFetchingMoreEmails && + !firstQueryLoading + ) { setIsFetchingMoreEmails(true); await fetchMore({ @@ -144,7 +153,7 @@ export const EmailThreads = ({ } fontColor={H1TitleFontColor.Primary} /> - {!loading && ( + {!firstQueryLoading && ( {timelineThreads?.map((thread: TimelineThread, index: number) => ( )}