Skip to content

Commit

Permalink
fix notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
not-nullptr committed Jul 14, 2024
1 parent 29a652e commit e2868a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions layouts/header/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2866,9 +2866,11 @@ let userDataFunction = async user => {
}
}
const tlUsers = data.list.filter(i => i.type === 'tweet').map(i => i.user.id_str);
let linkData = await getLinkColors(tlUsers);
if(linkData) for(let i in linkData) {
linkColors[linkData[i].id] = linkData[i].color;
if (typeof linkColors !== "undefined") {
let linkData = await getLinkColors(tlUsers);
if(linkData) for(let i in linkData) {
linkColors[linkData[i].id] = linkData[i].color;
}
}
if(options.mode === 'append' || options.mode === 'rewrite') {
cursorBottom = data.cursorBottom;
Expand Down
3 changes: 2 additions & 1 deletion layouts/home/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ setTimeout(async () => {
// On scroll to end of timeline, load more tweets
let loadingNewTweets = false;
document.addEventListener('scroll', async () => {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 5000) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight - 5000 && window.scrollY > 20) {
if (loadingNewTweets || timeline.data.length === 0) return;
document.getElementById('load-more').click();
console.log("Loading more tweets...");
}
}, { passive: true });

Expand Down

0 comments on commit e2868a8

Please sign in to comment.