no additional fetches needed when on featured tab

This commit is contained in:
Abbey Campbell
2025-12-15 14:34:26 -08:00
parent 788246b187
commit 23661e7506

View File

@@ -1,5 +1,5 @@
import _ from "lodash";
import React, { useState } from "react";
import React, { useCallback, useState } from "react";
import {
useCurrentUser,
useLocationPermission,
@@ -93,11 +93,17 @@ const ProjectsContainer = ( ) => {
tabs.shift( );
}
const handleFetchNextPage = useCallback( () => {
if ( currentTabId !== TAB_ID.FEATURED ) {
fetchNextPage();
}
}, [currentTabId, fetchNextPage] );
return (
<>
<Projects
currentTabId={currentTabId}
fetchNextPage={fetchNextPage}
fetchNextPage={handleFetchNextPage}
hasPermissions={hasPermissions}
isFetchingNextPage={isFetchingNextPage}
isLoading={isFetching}