Last remaining componentWillReceiveProps, whew

This commit is contained in:
James Barnsley
2020-03-12 21:32:50 +13:00
parent 29b7b65b9c
commit 28fc55bad1
18 changed files with 6810 additions and 10005 deletions

View File

@ -16,11 +16,9 @@ class LibraryBrowse extends React.Component {
this.props.uiActions.setWindowTitle('Browse');
}
componentWillReceiveProps(nextProps) {
// mopidy goes online
if (!this.props.mopidy_connected && nextProps.mopidy_connected) {
this.loadDirectory(nextProps);
}
componentDidUpdate = ({ mopidy_connected: prev_mopidy_connected}) => {
const { mopidy_connected } = this.props;
if (!prev_mopidy_connected && mopidy_connected) this.loadDirectory();
}
loadDirectory(props = this.props) {