Added stop button

This commit is contained in:
2022-11-03 17:39:09 +01:00
parent 03d19a2544
commit e28a20a7c6
3 changed files with 10 additions and 6 deletions

View File

@@ -86,13 +86,14 @@ block.fn.tweets = function(config) {
tweets.shift();
}
window.sessionStorage.setItem('tweets', JSON.stringify(tweets));
if(!paused) {
// remove tweets
$list.replaceChildren();
var displayTweets = tweets.reverse().slice(0, options.memory).reverse();
for (i = 0; i < Math.min(options.memory-1, displayTweets.length); i++){
$list.prepend(tweetCell(displayTweets[i]));
}
}
});