Using universal tracks index instead of current_track
This commit is contained in:
@ -14,7 +14,18 @@ const localstorageMiddleware = (function(){
|
||||
window._store = store
|
||||
|
||||
// if debug enabled
|
||||
if (store.getState().ui.log_actions) console.log(action)
|
||||
if (store.getState().ui.log_actions){
|
||||
|
||||
var ignored_actions = [
|
||||
'START_LOADING',
|
||||
'STOP_LOADING'
|
||||
]
|
||||
|
||||
// Show non-ignored actions
|
||||
if (!ignored_actions.includes(action.type)){
|
||||
console.log(action)
|
||||
}
|
||||
}
|
||||
|
||||
switch( action.type ){
|
||||
|
||||
|
||||
@ -118,8 +118,7 @@ export default function reducer(ui = {}, action){
|
||||
)
|
||||
}
|
||||
|
||||
var current_track = action.data.track
|
||||
Object.assign(current_track, { tlid: action.data.tlid })
|
||||
var current_track = action.data.track.uri
|
||||
|
||||
return Object.assign({}, ui, {
|
||||
current_track: current_track
|
||||
@ -410,6 +409,8 @@ export default function reducer(ui = {}, action){
|
||||
**/
|
||||
|
||||
case 'TRACK_LOADED':
|
||||
if (!action.key || !action.track) return ui
|
||||
|
||||
var tracks = Object.assign({}, ui.tracks)
|
||||
|
||||
if (tracks[action.key]){
|
||||
|
||||
Reference in New Issue
Block a user