diff --git a/src/controllers/shows/tvupcoming.js b/src/controllers/shows/tvupcoming.js index 65db7731e0e..53d9aaf5a7b 100644 --- a/src/controllers/shows/tvupcoming.js +++ b/src/controllers/shows/tvupcoming.js @@ -45,7 +45,7 @@ function enableScrollX() { function renderUpcoming(elem, items) { const groups = []; - let currentGroupName = ''; + let currentGroupName; let currentGroup = []; for (let i = 0, length = items.length; i < length; i++) { @@ -66,15 +66,13 @@ function renderUpcoming(elem, items) { } if (dateText != currentGroupName) { - if (currentGroup.length) { - groups.push({ - name: currentGroupName, - items: currentGroup - }); - } - currentGroupName = dateText; currentGroup = [item]; + + groups.push({ + name: currentGroupName, + items: currentGroup + }); } else { currentGroup.push(item); }