Moving can_edit on playlists to ui middleware, fixes #73

This commit is contained in:
James Barnsley
2017-03-20 18:20:59 +13:00
parent 423c5ae91f
commit 98e4e2db54
4 changed files with 28 additions and 5 deletions

View File

@ -132,7 +132,6 @@ const SpotifyMiddleware = (function(){
{},
action.data.items[i],
{
can_edit: (store.getState().spotify.authorized && store.getState().spotify.me && action.data.items[i].owner.id == store.getState().spotify.me.id),
tracks_total: action.data.items[i].tracks.total
}
)
@ -164,7 +163,6 @@ const SpotifyMiddleware = (function(){
{},
action.data.playlists.items[i],
{
can_edit: (store.getState().spotify.authorized && store.getState().spotify.me && action.data.playlists.items[i].owner.id == store.getState().spotify.me.id),
tracks_total: action.data.playlists.items[i].tracks.total
}
)
@ -198,7 +196,6 @@ const SpotifyMiddleware = (function(){
{
source: 'spotify',
in_library: true, // assumed because we asked for library items
can_edit: (store.getState().spotify.authorized && store.getState().spotify.me && action.playlists[i].owner.id == store.getState().spotify.me.id),
tracks_total: action.playlists[i].tracks.total
}
)
@ -320,7 +317,6 @@ const SpotifyMiddleware = (function(){
{},
action.data.playlists.items[i],
{
can_edit: (getState().spotify.me && action.data.playlists.items[i].owner.id == getState().spotify.me.id),
tracks_total: action.data.playlists.items[i].tracks.total
}
))