This commit is contained in:
Albert Juhé Lluveras 2019-07-12 13:20:42 +02:00 committed by Mike Jolley
parent 10873b8503
commit 1cbef7dd39
4 changed files with 16 additions and 0 deletions

View File

@ -112,6 +112,10 @@ class FeaturedCategory extends Component {
this.getCategory(); this.getCategory();
} }
componentWillUnmount() {
this.debouncedGetCategory.cancel();
}
componentDidUpdate( prevProps ) { componentDidUpdate( prevProps ) {
if ( prevProps.attributes.categoryId !== this.props.attributes.categoryId ) { if ( prevProps.attributes.categoryId !== this.props.attributes.categoryId ) {
this.debouncedGetCategory(); this.debouncedGetCategory();

View File

@ -96,6 +96,10 @@ class FeaturedProduct extends Component {
this.getProduct(); this.getProduct();
} }
componentWillUnmount() {
this.debouncedGetProduct.cancel();
}
componentDidUpdate( prevProps ) { componentDidUpdate( prevProps ) {
if ( prevProps.attributes.productId !== this.props.attributes.productId ) { if ( prevProps.attributes.productId !== this.props.attributes.productId ) {
this.debouncedGetProduct(); this.debouncedGetProduct();

View File

@ -51,6 +51,10 @@ class ProductAttributeControl extends Component {
} ); } );
} }
componentWillUnmount() {
this.debouncedGetTerms.cancel();
}
componentDidUpdate( prevProps, prevState ) { componentDidUpdate( prevProps, prevState ) {
if ( prevState.attribute !== this.state.attribute ) { if ( prevState.attribute !== this.state.attribute ) {
this.debouncedGetTerms(); this.debouncedGetTerms();

View File

@ -35,6 +35,10 @@ class ProductsControl extends Component {
} ); } );
} }
componentWillUnmount() {
this.debouncedOnSearch.cancel();
}
onSearch( search ) { onSearch( search ) {
const { selected } = this.props; const { selected } = this.props;
getProducts( { selected, search } ) getProducts( { selected, search } )