Spotify checkToken before any critical request

This commit is contained in:
James Barnsley
2016-10-21 16:34:16 +13:00
parent afb6bb7a0d
commit 667efba1f7
7 changed files with 83 additions and 30 deletions

View File

@ -143,6 +143,9 @@ const MopidyMiddleware = (function(){
// play it
store.dispatch( actions.changeTrack( response[0].tlid ) );
// TODO: perhaps force update of currentTlTrack before we proceed?
// this will make the UI feel snappier...
// add the rest of our uris (if any)
action.uris.shift();
if( action.uris.length > 0 ){

View File

@ -20,6 +20,7 @@ export default function reducer(mopidy = {}, action){
});
case 'MOPIDY_HIGHLIGHT_CURRENT_TLTRACK':
if( !action.data ) return mopidy;
for( var i = 0; i < mopidy.tracks.length; i++ ){
if( mopidy.tracks[i].tlid == action.data.tlid ){
action.data.track.playing = true;