Merge branch 'Anarios:main' into main

This commit is contained in:
hyperstown authored and GitHub committed 2022-10-01 00:09:13 +02:00
commit 69d4a68656
6 files changed
+12 -3

No files matched your search

@@ -58,6 +58,9 @@ function isInViewport(element) {
const height = innerHeight || document.documentElement.clientHeight;
const width = innerWidth || document.documentElement.clientWidth;
return (
// When short (channel) is ignored, the element (like/dislike AND short itself) is
// hidden with a 0 DOMRect. In this case, consider it outside of Viewport
!(rect.top == 0 && rect.left == 0 && rect.bottom == 0 && rect.right == 0) &&
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= height &&
@@ -240,6 +243,7 @@ function setDislikes(dislikesCount) {
mobileDislikes = dislikesCount;
return;
}
getDislikeTextContainer()?.removeAttribute('is-empty');
getDislikeTextContainer().innerText = dislikesCount;
}