import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { Link, hashHistory } from 'react-router' import FontAwesome from 'react-fontawesome' import ArtistSentence from './ArtistSentence' import * as helpers from '../helpers' import * as coreActions from '../services/core/actions' import * as uiActions from '../services/ui/actions' import * as pusherActions from '../services/pusher/actions' class Snapcast extends React.Component{ constructor(props){ super(props) } componentDidMount(){ if (this.props.pusher_connected){ this.props.pusherActions.getSnapcast(); } } componentWillReceiveProps(newProps){ if (!this.props.pusher_connected && newProps.pusher_connected){ this.props.pusherActions.getSnapcast(); } } render(){ if (!this.props.snapcast){ return null; } var clients = []; for (var client_id in this.props.snapcast_clients){ if (this.props.snapcast_clients.hasOwnProperty(client_id)){ clients.push(this.props.snapcast_clients[client_id]); } } return (