This commit is contained in:
Boro Sitnikovski 2024-09-12 14:17:07 +02:00
parent a10eb02a40
commit 0b2d2dca6d
3 changed files with 10 additions and 4 deletions

View File

@ -167,7 +167,13 @@ export default function Content(): JSX.Element {
controller.abort(); controller.abort();
} ); } );
}; };
}, [ query.term, query.category ] ); // Depend on term and category }, [
query.term,
query.category,
setHasBusinessServices,
setIsLoading,
setSearchResultsCount,
] ); // Depend on term and category
// Filter the products based on the selected tab // Filter the products based on the selected tab
useEffect( () => { useEffect( () => {

View File

@ -67,7 +67,7 @@ export default function NoResults( props: {
.finally( () => { .finally( () => {
setIsLoading( false ); setIsLoading( false );
} ); } );
}, [] ); }, [ productGroupsForSearchType, props.type ] );
function productListTitle( groupId: string ) { function productListTitle( groupId: string ) {
if ( groupId === 'popular-themes' ) { if ( groupId === 'popular-themes' ) {

View File

@ -178,7 +178,7 @@ const Tabs = ( props: TabsProps ): JSX.Element => {
} else if ( Object.keys( query ).length > 0 ) { } else if ( Object.keys( query ).length > 0 ) {
setSelectedTab( DEFAULT_TAB_KEY ); setSelectedTab( DEFAULT_TAB_KEY );
} }
}, [ query, setSelectedTab ] ); }, [ query, setSelectedTab, tabs ] );
useEffect( () => { useEffect( () => {
setVisibleTabs( setVisibleTabs(
@ -188,7 +188,7 @@ const Tabs = ( props: TabsProps ): JSX.Element => {
if ( selectedTab === 'business-services' && ! hasBusinessServices ) { if ( selectedTab === 'business-services' && ! hasBusinessServices ) {
setUrlTabParam( 'extensions', query ); setUrlTabParam( 'extensions', query );
} }
}, [ selectedTab, hasBusinessServices ] ); }, [ selectedTab, hasBusinessServices, query, tabs ] );
return ( return (
<nav <nav