_library_started switch to indicate whether we've started loading
This commit is contained in:
@ -241,21 +241,14 @@ export default function reducer(ui = {}, action){
|
||||
return Object.assign({}, ui, { albums: albums });
|
||||
|
||||
case 'LIBRARY_ALBUMS_LOADED':
|
||||
if (!action.uris){
|
||||
return Object.assign({}, ui, {
|
||||
library_albums: null,
|
||||
library_albums_more: null,
|
||||
library_albums_total: null
|
||||
});
|
||||
}
|
||||
|
||||
var library_albums = []
|
||||
if (ui.library_albums) library_albums = Object.assign([], ui.library_albums)
|
||||
|
||||
return Object.assign({}, ui, {
|
||||
library_albums: [...library_albums, ...action.uris],
|
||||
library_albums: helpers.removeDuplicates([...library_albums, ...action.uris]),
|
||||
library_albums_more: action.more,
|
||||
library_albums_total: action.total
|
||||
library_albums_total: action.total,
|
||||
library_albums_started: true
|
||||
});
|
||||
|
||||
case 'ALBUM_LIBRARY_CHECK':
|
||||
@ -347,21 +340,14 @@ export default function reducer(ui = {}, action){
|
||||
return Object.assign({}, ui, { artists: artists });
|
||||
|
||||
case 'LIBRARY_ARTISTS_LOADED':
|
||||
if (!action.uris){
|
||||
return Object.assign({}, ui, {
|
||||
library_artists: null,
|
||||
library_artists_more: null,
|
||||
library_artists_total: null
|
||||
});
|
||||
}
|
||||
|
||||
var library_artists = []
|
||||
if (ui.library_artists) library_artists = Object.assign([], ui.library_artists)
|
||||
|
||||
return Object.assign({}, ui, {
|
||||
library_artists: [...library_artists, ...action.uris],
|
||||
library_artists: helpers.removeDuplicates([...library_artists, ...action.uris]),
|
||||
library_artists_more: action.more,
|
||||
library_artists_total: action.total
|
||||
library_artists_total: action.total,
|
||||
library_artists_started: true
|
||||
});
|
||||
|
||||
case 'ARTIST_LIBRARY_CHECK':
|
||||
@ -551,7 +537,8 @@ export default function reducer(ui = {}, action){
|
||||
library_playlists = helpers.removeDuplicates(library_playlists)
|
||||
|
||||
return Object.assign({}, ui, {
|
||||
library_playlists: library_playlists
|
||||
library_playlists: library_playlists,
|
||||
library_playlists_loaded: true
|
||||
});
|
||||
|
||||
case 'PLAYLIST_LIBRARY_CHECK':
|
||||
|
||||
Reference in New Issue
Block a user