diff --git a/src/js/components/Modal/AddToPlaylistModal.js b/src/js/components/Modal/AddToPlaylistModal.js index db627498..b1c8ec01 100755 --- a/src/js/components/Modal/AddToPlaylistModal.js +++ b/src/js/components/Modal/AddToPlaylistModal.js @@ -1,5 +1,6 @@ import React, { PropTypes } from 'react' +import FontAwesome from 'react-fontawesome' import Icon from '../Icon' import * as helpers from '../../helpers' @@ -22,16 +23,22 @@ export default class AddToPlaylistModal extends React.Component{ } return ( -
- { - playlists.map( playlist => { - return ( -
this.playlistSelected(playlist.uri) }> - { playlist.name } -
- ) - }) - } +
+

Add to playlist

+
+ { + playlists.map( playlist => { + return ( +
this.playlistSelected(playlist.uri) }> + +   + { playlist.name } + { playlist.tracks ?  { playlist.tracks.total } tracks : null } +
+ ) + }) + } +
) } diff --git a/src/js/services/localstorage/middleware.js b/src/js/services/localstorage/middleware.js index 101873b3..68da3581 100755 --- a/src/js/services/localstorage/middleware.js +++ b/src/js/services/localstorage/middleware.js @@ -12,7 +12,7 @@ const localstorageMiddleware = (function(){ // append our state to a global variable. This gives us access to debug the store at any point window._store = store - //console.log(action) + console.log(action) switch( action.type ){ diff --git a/src/js/services/pusher/middleware.js b/src/js/services/pusher/middleware.js index 1c03eebe..d3cecb59 100755 --- a/src/js/services/pusher/middleware.js +++ b/src/js/services/pusher/middleware.js @@ -11,8 +11,9 @@ const PusherMiddleware = (function(){ const handleMessage = (ws, store, message) => { switch( message.action ){ default: - var name = message.action.toUpperCase(); - name = name.replace('GET_',''); + var name = 'unspecified' + if( message.action ) name = message.action + name = name.replace('GET_','').toUpperCase() store.dispatch({ type: 'PUSHER_'+name, data: message.data }) } }