Making WordPress.org


Ignore:
Timestamp:
08/03/2016 06:16:09 PM (8 years ago)
Author:
obenland
Message:

Plugin Directory: Use correct property to get page slug.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/client/components/page/index.jsx

    r3734 r3769  
    1 import React, { Component } from 'react';
     1import React from 'react';
    22import { connect } from 'react-redux';
    33import find from 'lodash/find';
     
    99import { getPage } from 'actions';
    1010
    11 class PageContainer extends Component {
     11const PageContainer = React.createClass( {
    1212    componentDidMount() {
    1313        this.getPage();
    14     }
     14    },
    1515
    1616    componentDidUpdate( previousProps ) {
    17         if ( this.props.route.name !== previousProps.route.name ) {
     17        if ( this.props.route.path !== previousProps.route.path ) {
    1818            this.getPage();
    1919        }
    20     }
     20    },
    2121
    2222    getPage() {
    23         this.props.dispatch( getPage( this.props.route.name ) );
    24     }
     23        this.props.dispatch( getPage( this.props.route.path ) );
     24    },
    2525
    2626    render() {
    2727        return <Page { ...this.props } />;
    2828    }
    29 }
     29} );
    3030
    3131const mapStateToProps = ( state, ownProps ) => ( {
    32     page: find( state.pages, { slug: ownProps.route.name } )
     32    page: find( state.pages, { slug: ownProps.route.path } )
    3333} );
    3434
Note: See TracChangeset for help on using the changeset viewer.