Working through ReactJS lifecycle deprecations

This commit is contained in:
James Barnsley
2019-11-15 13:50:39 +13:00
parent f5db13f17c
commit 0206fb7c69
18 changed files with 20078 additions and 15360 deletions

View File

@ -29,17 +29,15 @@ class LibraryPlaylists extends React.Component {
};
}
componentWillMount() {
// Before we mount, restore any limit defined in our location state
componentDidMount() {
// Restore any limit defined in our location state
const state = (this.props.location.state ? this.props.location.state : {});
if (state.limit) {
this.setState({
limit: state.limit,
});
}
}
componentDidMount() {
this.props.uiActions.setWindowTitle('Playlists');
if (!this.props.mopidy_library_playlists && this.props.mopidy_connected && (this.props.source == 'all' || this.props.source == 'local')) {