Update module.js

This commit is contained in:
Rodrigo Emanuel
2025-05-21 02:26:26 -03:00
committed by GitHub
parent 2f74c9084f
commit 12db7b715e

View File

@@ -160,19 +160,20 @@ async function tiktokLikesMessage(data) {
var likeCountTotal = parseInt(likesSent);
// Search for Previous Likes from the Same User
const previousLikeContainer = chatContainer.querySelector(`div.message[data-user="${userID}"]`);
const previousLikeContainer = chatContainer.querySelector(`div.message.likes[data-user="${userID}"]`);
// If found, fetches the previous likes, deletes the element
// and then creates a new count with a sum of the like count
if (previousLikeContainer) {
const likeCountElem = previousLikeContainer.querySelector('.likecount');
if (likeCountElem && likeCountElem.textContent) {
if (likeCountElem) {
var likeCountPrev = parseInt(likeCountElem.textContent);
likeCountTotal = Math.floor(likeCountPrev + likeCountTotal);
previousLikeContainer.remove();
}
}
const message = currentLang.tiktok.likes(likeCountTotal)
const classes = 'likes'