diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc index ab7ebca..986186a 100644 Binary files a/__pycache__/dashboard.cpython-310.pyc and b/__pycache__/dashboard.cpython-310.pyc differ diff --git a/dashboard_static/js/events.js b/dashboard_static/js/events.js index 8a49af8..015b661 100644 --- a/dashboard_static/js/events.js +++ b/dashboard_static/js/events.js @@ -81,7 +81,7 @@ $(window).on("filter", function() { tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords.concat(filters.sports), filters.sorted, filters.order); tweets = sortTweets(tweets, [filters.sorted, filters.order]); var displayTweets = tweets.reverse().slice(0, 20).reverse(); - for (i = 0; i < 19; i++){ + for (i = 0; i < Math.min(19, displayTweets.length); i++){ tweet = displayTweets[i]; parent.prepend(tweetCell(tweet)); } diff --git a/dashboard_static/lib/tweets.js b/dashboard_static/lib/tweets.js index da10619..3addfcb 100644 --- a/dashboard_static/lib/tweets.js +++ b/dashboard_static/lib/tweets.js @@ -90,7 +90,7 @@ block.fn.tweets = function(config) { // remove tweets $list.replaceChildren(); var displayTweets = tweets.reverse().slice(0, options.memory).reverse(); - for (i = 0; i < options.memory-1; i++){ + for (i = 0; i < Math.min(options.memory-1, displayTweets.length); i++){ $list.prepend(tweetCell(displayTweets[i])); }