Commit e6f8b3c0 authored by David Trattnig's avatar David Trattnig
Browse files

Fix: Correct rendering of all episodes

parent 483c2373
Pipeline #1984 passed with stages
in 10 minutes and 11 seconds
......@@ -138,14 +138,15 @@
/** Process the API Episodes results when "Load More" was initiated */
function processMoreEpisodes(data) {
if (data && data.error) {
console.log('No more episodes to load:', data.error)
// #FIXME API should handle 0 records not as an error / this case should compare for 0 records
hasMoreEpisodes = false
show = tmp_show
return
data = []
}
// #TODO The episodes should be provided ordered ascending by the API already (Ability to sort)
if (data != null && Array.isArray(data)) data = data.reverse()
episodes = episodesNext.concat(episodes.concat(data))
data.unshift(episodes[0])
episodes = episodesNext.concat(data)
labelEpisodes = labelAllEpisodes
hasMoreEpisodes = false
console.log('More episodes of show API response:', data)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment