|
@@ -8,9 +8,16 @@ import { openOverlay2 } from "actions/stationOverlay";
|
|
|
import io from "io";
|
|
|
|
|
|
@connect(state => ({
|
|
|
+ user: {
|
|
|
+ loggedIn: state.session.get("loggedIn"),
|
|
|
+ userId: state.session.get("userId"),
|
|
|
+ role: state.session.get("role"),
|
|
|
+ },
|
|
|
station: {
|
|
|
stationId: state.station.info.get("stationId"),
|
|
|
+ ownerId: state.station.info.get("ownerId"),
|
|
|
mode: state.station.info.get("mode"),
|
|
|
+ privatePlaylist: state.station.info.get("privatePlaylist"),
|
|
|
},
|
|
|
}))
|
|
|
export default class PlaylistItem extends Component {
|
|
@@ -19,15 +26,15 @@ export default class PlaylistItem extends Component {
|
|
|
}
|
|
|
|
|
|
isOwner = () => {
|
|
|
- if (this.props.loggedIn) {
|
|
|
- if (this.props.user.userId === this.props.stationOwner) return true;
|
|
|
+ if (this.props.user.loggedIn) {
|
|
|
+ if (this.props.user.userId === this.props.station.ownerId) return true;
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
};
|
|
|
|
|
|
playPlaylist = (playlistId) => {
|
|
|
- this.messages.clearErrorSuccess();
|
|
|
+ //this.messages.clearErrorSuccess();
|
|
|
io.getSocket((socket) => {
|
|
|
socket.emit("stations.selectPrivatePlaylist", this.props.station.stationId, playlistId, (res) => {
|
|
|
if (res.status === "success") {
|
|
@@ -46,7 +53,7 @@ export default class PlaylistItem extends Component {
|
|
|
//const stop = <span onClick={ () => { this.stopPlaylist(playlistId) } }>STOP!</span>;
|
|
|
const stop = null; // There's currently no backend functionality to stop a playlist from playing
|
|
|
|
|
|
- if (this.props.privatePlaylist === playlistId) return stop;
|
|
|
+ if (this.props.station.privatePlaylist === playlistId) return stop;
|
|
|
else return play;
|
|
|
}
|
|
|
}
|