File size: 740 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import PropTypes from 'prop-types';
import { Component } from 'react';
import { connect } from 'react-redux';
import { requestJetpackProductInstallStatus } from 'calypso/state/jetpack-product-install/actions';

class QueryJetpackProductInstallStatus extends Component {
	static propTypes = {
		siteId: PropTypes.number.isRequired,
	};

	componentDidMount() {
		this.props.requestJetpackProductInstallStatus( this.props.siteId );
	}

	componentDidUpdate( prevProps ) {
		if ( prevProps.siteId !== this.props.siteId ) {
			this.props.requestJetpackProductInstallStatus( this.props.siteId );
		}
	}

	render() {
		return null;
	}
}

export default connect( null, {
	requestJetpackProductInstallStatus,
} )( QueryJetpackProductInstallStatus );