Moving selector outside of mapStateToProps (d'oh)
This commit is contained in:
@ -18,6 +18,7 @@ import Loader from '../../components/Loader';
|
||||
import {
|
||||
makeLibrarySelector,
|
||||
makeProcessProgressSelector,
|
||||
getLibrarySource,
|
||||
} from '../../util/selectors';
|
||||
|
||||
const processKeys = [
|
||||
@ -304,8 +305,9 @@ class LibraryPlaylists extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const librarySelector = makeLibrarySelector('playlists');
|
||||
const processProgressSelector = makeProcessProgressSelector(processKeys);
|
||||
const mapStateToProps = (state) => {
|
||||
const source = state.ui.library_playlists_source || 'all';
|
||||
const {
|
||||
spotify: {
|
||||
me: {
|
||||
@ -314,20 +316,13 @@ const mapStateToProps = (state) => {
|
||||
},
|
||||
} = state;
|
||||
|
||||
const libraryUris = [];
|
||||
if (source === 'all' || source === 'local') libraryUris.push('mopidy:library:playlists');
|
||||
if (source === 'all' || source === 'spotify') libraryUris.push('spotify:library:playlists');
|
||||
if (source === 'all' || source === 'google') libraryUris.push('google:library:playlists');
|
||||
const librarySelector = makeLibrarySelector(libraryUris);
|
||||
const processProgressSelector = makeProcessProgressSelector(processKeys);
|
||||
|
||||
return {
|
||||
slim_mode: state.ui.slim_mode,
|
||||
mopidy_uri_schemes: state.mopidy.uri_schemes,
|
||||
spotify_available: state.spotify.access_token,
|
||||
playlists: librarySelector(state),
|
||||
playlists: librarySelector(state, 'playlists'),
|
||||
loading_progress: processProgressSelector(state),
|
||||
source,
|
||||
source: getLibrarySource(state, 'playlists'),
|
||||
me_id,
|
||||
view: state.ui.library_playlists_view,
|
||||
sort: (state.ui.library_playlists_sort ? state.ui.library_playlists_sort : null),
|
||||
|
||||
Reference in New Issue
Block a user