import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import Link from '../../components/Link'; import TrackList from '../../components/TrackList'; import Header from '../../components/Header'; import LazyLoadListener from '../../components/LazyLoadListener'; import Icon from '../../components/Icon'; import * as helpers from '../../helpers'; import * as uiActions from '../../services/ui/actions'; import * as mopidyActions from '../../services/mopidy/actions'; import * as spotifyActions from '../../services/spotify/actions'; class LibraryTracks extends React.Component { constructor(props) { super(props); } // on render componentDidMount() { this.props.uiActions.setWindowTitle('Tracks'); if (!this.props.spotify_me) { this.props.uiActions.createNotification({ type: 'warning', content: 'Enable Spotify to browse tracks' }); } else if (this.props.library_tracks === undefined) { this.props.spotifyActions.getLibraryTracks(); } } loadMore() { this.props.spotifyActions.getMore( this.props.library_tracks_more, null, { type: 'SPOTIFY_LIBRARY_TRACKS_LOADED_MORE', }, ); } playAll() { this.props.spotifyActions.getLibraryTracksAndPlay(); } render() { // Note trailing "?" makes sure our context menu in_library checks doesn't interfere if (helpers.isLoading(this.props.load_queue, ['spotify_me/tracks?'])) { return (