import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import TrackList from '../components/TrackList'; import Header from '../components/Header'; import Icon from '../components/Icon'; import * as uiActions from '../services/ui/actions'; import * as pusherActions from '../services/pusher/actions'; import * as spotifyActions from '../services/spotify/actions'; import * as mopidyActions from '../services/mopidy/actions'; import { i18n, I18n } from '../locale'; import Button from '../components/Button'; import { arrayOf } from '../util/arrays'; import { getItemsFromIndex } from '../util/selectors'; class QueueHistory extends React.Component { componentDidMount() { const { uiActions: { setWindowTitle } } = this.props; setWindowTitle(i18n('queue_history.title')); this.loadHistory(); } shouldComponentUpdate = ({ tracks: nextTracks }) => { const { tracks } = this.props; return nextTracks.length !== tracks.length; } loadHistory = () => { const { mopidyActions: { getQueueHistory, }, } = this.props; getQueueHistory(); } onBack = () => { const { history: { push } } = this.props; push('/queue'); } render = () => { const { tracks, uiActions, } = this.props; const options = ( ); return (