Window title track
This commit is contained in:
@ -272,7 +272,7 @@ const CoreMiddleware = (function(){
|
||||
|
||||
case 'MOPIDY_CURRENTTLTRACK':
|
||||
if (action.data && action.data.track){
|
||||
helpers.setWindowTitle(action.data.track, store.getState().mopidy.play_state)
|
||||
helpers.setWindowTitle(action.data.track, store.getState().mopidy.play_state);
|
||||
|
||||
// make sure our images use mopidy host:port
|
||||
if (action.data.track.album && action.data.track.album.images && action.data.track.album.images.length > 0){
|
||||
|
||||
@ -15,8 +15,17 @@ const UIMiddleware = (function(){
|
||||
switch(action.type){
|
||||
|
||||
case 'MOPIDY_STATE':
|
||||
helpers.setWindowTitle(store.getState().core.current_track, action.data)
|
||||
next(action)
|
||||
|
||||
// Get the current track from our index
|
||||
var tracks = store.getState().core.tracks;
|
||||
var current_track_uri = store.getState().core.current_track;
|
||||
var current_track = null;
|
||||
if (tracks[current_track_uri] !== undefined){
|
||||
current_track = tracks[current_track_uri];
|
||||
}
|
||||
|
||||
helpers.setWindowTitle(current_track, action.data);
|
||||
next(action);
|
||||
break
|
||||
|
||||
case 'OPEN_MODAL':
|
||||
|
||||
Reference in New Issue
Block a user