Beyond query.term, also rely on isLoading so that search result counts don't jump

This commit is contained in:
Boro Sitnikovski 2024-09-11 17:33:05 +02:00
parent 1ae4d2fbbf
commit 89a00e89bd
1 changed files with 4 additions and 4 deletions

View File

@ -129,7 +129,7 @@ const renderTabs = (
const Tabs = ( props: TabsProps ): JSX.Element => {
const { additionalClassNames } = props;
const marketplaceContextValue = useContext( MarketplaceContext );
const { selectedTab, setSelectedTab, hasBusinessServices } =
const { selectedTab, isLoading, setSelectedTab, hasBusinessServices } =
marketplaceContextValue;
const { searchResultsCount } = marketplaceContextValue;
@ -145,19 +145,19 @@ const Tabs = ( props: TabsProps ): JSX.Element => {
extensions: {
name: 'extensions',
title: __( 'Extensions', 'woocommerce' ),
showUpdateCount: !! query.term,
showUpdateCount: !! query.term && ! isLoading,
updateCount: searchResultsCount.extensions,
},
themes: {
name: 'themes',
title: __( 'Themes', 'woocommerce' ),
showUpdateCount: !! query.term,
showUpdateCount: !! query.term && ! isLoading,
updateCount: searchResultsCount.themes,
},
'business-services': {
name: 'business-services',
title: __( 'Business services', 'woocommerce' ),
showUpdateCount: !! query.term,
showUpdateCount: !! query.term && ! isLoading,
updateCount: searchResultsCount[ 'business-services' ],
},
'my-subscriptions': {