diff --git a/tubearchivist/static/stats.js b/tubearchivist/static/stats.js index 8a2616c..03e89b5 100644 --- a/tubearchivist/static/stats.js +++ b/tubearchivist/static/stats.js @@ -100,6 +100,12 @@ function downloadHist() { let apiEndpoint = '/api/stats/downloadhist/'; let responseData = apiRequest(apiEndpoint, 'GET'); let histBox = document.getElementById('downHistBox'); + if (responseData.length === 0) { + let tile = buildTile('No recent downloads'); + histBox.appendChild(tile); + return; + } + for (let i = 0; i < responseData.length; i++) { const dailyStat = responseData[i]; let tile = buildDailyStat(dailyStat);