Added if statement

This commit is contained in:
2022-11-03 15:14:03 +01:00
parent 8143421190
commit 6bcdaf7d8c
3 changed files with 2 additions and 2 deletions

View File

@@ -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]));
}