Skip to content

Commit

Permalink
Fix queries
Browse files Browse the repository at this point in the history
Use nextProps, otherwise we just get old props, and searching/tiering
doesn't work.
  • Loading branch information
ehg committed Dec 1, 2015
1 parent 3a70be6 commit 0aca329
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions shared/components/data/themes-list-fetcher/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ThemesListFetcher = React.createClass( {
},

componentDidMount: function() {
this.refresh();
this.refresh( this.props );
},

componentWillReceiveProps: function( nextProps ) {
Expand All @@ -71,17 +71,17 @@ const ThemesListFetcher = React.createClass( {

if ( propKeys.some( key => this.props[ key ] !== nextProps[ key ] ) ) {
console.log( 'props changed' );
this.refresh();
this.refresh( nextProps );
}
},

refresh: function() {
refresh: function( props ) {
if ( this.props.site || this.props.isMultisite ) {
this.queryThemes();
this.queryThemes( props );
}
},

queryThemes: function() {
queryThemes: function( props ) {
const {
onLastPage,
site,
Expand All @@ -90,7 +90,7 @@ const ThemesListFetcher = React.createClass( {

query,
fetchNextPage
} = this.props;
} = props;

this.onLastPage = onLastPage ? once( onLastPage ) : null;

Expand Down

0 comments on commit 0aca329

Please sign in to comment.