Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions _inc/client/plans/plan-grid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import analytics from 'lib/analytics';
import Button from 'components/button';
import ButtonGroup from 'components/button-group';
import { getSiteRawUrl, getUpgradeUrl, getUserId, showBackups } from 'state/initial-state';
import { getSitePlan, getAvailablePlans } from 'state/site/reducer';
import { getSitePlan, getAvailablePlans, isFetchingSiteData } from 'state/site/reducer';
import { getPlanClass } from 'lib/plans/constants';
import { isFetchingProducts } from '../state/products';
import { translate as __ } from 'i18n-calypso';
import TopButton from './top-button';
import FeatureItem from './feture-item';
Expand Down Expand Up @@ -61,7 +62,7 @@ class PlanGrid extends React.Component {
}

render() {
if ( ! this.props.plans ) {
if ( ! this.props.plans || this.props.isFetchingData ) {
return (
<div className="plan-features">
{ this.renderMobileCard() }
Expand Down Expand Up @@ -419,6 +420,7 @@ export default connect(
showBackups: showBackups( state ),
plansUpgradeUrl: planType => getUpgradeUrl( state, `plans-${ planType }`, userId ),
plansLearnMoreUpgradeUrl: getUpgradeUrl( state, 'plans-learn-more', userId ),
isFetchingData: isFetchingSiteData( state ) || isFetchingProducts( state ),
};
},
null
Expand Down
11 changes: 9 additions & 2 deletions _inc/client/plans/product-selector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import { get } from 'lodash';
import ProductCard from '../components/product-card';
import { SingleProductBackup } from './single-product-backup';
import { getPlanClass } from '../lib/plans/constants';
import { getActiveSitePurchases, getSitePlan, isFetchingSiteData } from '../state/site';
import {
getActiveSitePurchases,
getAvailablePlans,
getSitePlan,
isFetchingSiteData,
} from '../state/site';
import { getSiteRawUrl, getUpgradeUrl } from '../state/initial-state';
import { getProducts, isFetchingProducts } from '../state/products';

Expand Down Expand Up @@ -148,6 +153,7 @@ class ProductSelector extends Component {
const {
dailyBackupUpgradeUrl,
isFetchingData,
plans,
products,
realtimeBackupUpgradeUrl,
sitePlan,
Expand All @@ -173,7 +179,7 @@ class ProductSelector extends Component {
plan={ plan }
products={ products }
upgradeLinks={ upgradeLinks }
isFetchingData={ isFetchingData }
isFetchingData={ isFetchingData || ! plans }
/>
);
}
Expand All @@ -192,6 +198,7 @@ export default connect( state => {
return {
activeSitePurchases: getActiveSitePurchases( state ),
dailyBackupUpgradeUrl: getUpgradeUrl( state, 'jetpack-backup-daily' ),
plans: getAvailablePlans( state ),
products: getProducts( state ),
realtimeBackupUpgradeUrl: getUpgradeUrl( state, 'jetpack-backup-realtime' ),
sitePlan: getSitePlan( state ),
Expand Down