Skip to content

Commit

Permalink
Plugins Marketplace: Fix Manage Sites inconsistent states (#94143)
Browse files Browse the repository at this point in the history
  • Loading branch information
epeicher authored Sep 3, 2024
1 parent 15b416b commit abd52f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/my-sites/plugins/plugin-details-CTA/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { setBillingInterval } from 'calypso/state/marketplace/billing-interval/a
import { getBillingInterval } from 'calypso/state/marketplace/billing-interval/selectors';
import {
isRequestingForSites,
isRequestingForAllSites,
getSiteObjectsWithPlugin,
getPluginOnSite,
} from 'calypso/state/plugins/installed/selectors';
Expand Down Expand Up @@ -495,6 +496,8 @@ function GetStartedButton( { onClick, plugin, isMarketplaceProduct, startFreeTri
function ManageSitesButton( { plugin, installedOnSitesQuantity } ) {
const translate = useTranslate();
const [ displayManageSitePluginsModal, setDisplayManageSitePluginsModal ] = useState( false );
const isRequestingPlugins = useSelector( ( state ) => isRequestingForAllSites( state ) );

const toggleDisplayManageSitePluginsModal = useCallback( () => {
setDisplayManageSitePluginsModal( ( value ) => ! value );
}, [] );
Expand Down Expand Up @@ -525,6 +528,7 @@ function ManageSitesButton( { plugin, installedOnSitesQuantity } ) {
<Button
className="plugin-details-cta__manage-button"
onClick={ toggleDisplayManageSitePluginsModal }
busy={ isRequestingPlugins }
>
{ translate( 'Manage sites' ) }
</Button>
Expand Down

0 comments on commit abd52f4

Please sign in to comment.