Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Remove unneeded query retrieval instance method.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffstieler committed Jul 11, 2019
1 parent 4ff4b32 commit 697b8a7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions client/layout/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export class Controller extends Component {

componentDidUpdate( prevProps ) {
const prevQuery = this.getQuery( prevProps.location.search );
const prevBaseQuery = this.getBaseQuery( prevProps.location.search );
const baseQuery = this.getBaseQuery( this.props.location.search );
const prevBaseQuery = omit( this.getQuery( prevProps.location.search ), 'paged' );
const baseQuery = omit( this.getQuery( this.props.location.search ), 'paged' );

if ( prevQuery.paged > 1 && ! isEqual( prevBaseQuery, baseQuery ) ) {
getHistory().replace( getNewPath( { paged: 1 } ) );
Expand All @@ -107,16 +107,10 @@ export class Controller extends Component {
return parse( search );
}

getBaseQuery( searchString ) {
const query = this.getQuery( searchString );
delete query.paged;
return query;
}

render() {
const { page, match, location } = this.props;
const { url, params } = match;
const query = omit( this.getQuery( location.search ), 'page' );
const query = this.getQuery( location.search );

window.wpNavMenuUrlUpdate( page, query );
window.wpNavMenuClassChange( page, url );
Expand Down

0 comments on commit 697b8a7

Please sign in to comment.