mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Fixed formatting
This commit is contained in:
+19
-19
@@ -2763,28 +2763,28 @@ function TikTokLikes(data) {
|
|||||||
let likeCount = parseInt(data.likeCount);
|
let likeCount = parseInt(data.likeCount);
|
||||||
|
|
||||||
// Search for Previous Likes from the Same User
|
// Search for Previous Likes from the Same User
|
||||||
const previousLikeContainer = document.querySelector(`.likes[data-user-identifier="${data.userId}"]`);
|
const previousLikeContainer = document.querySelector(`.likes[data-user-identifier="${data.userId}"]`);
|
||||||
|
|
||||||
// If found, fetches the previous likes, deletes the element
|
// If found, fetches the previous likes, deletes the element
|
||||||
// and then creates a new count with a sum of the like count
|
// and then creates a new count with a sum of the like count
|
||||||
if (previousLikeContainer) {
|
if (previousLikeContainer) {
|
||||||
const likeCountElem = previousLikeContainer.querySelector('#tiktok-gift-repeat-count');
|
const likeCountElem = previousLikeContainer.querySelector('#tiktok-gift-repeat-count');
|
||||||
if (likeCountElem) {
|
if (likeCountElem) {
|
||||||
const liLikeContainer = previousLikeContainer.parentElement?.parentElement;
|
const liLikeContainer = previousLikeContainer.parentElement?.parentElement;
|
||||||
if (liLikeContainer) {
|
if (liLikeContainer) {
|
||||||
let prevLikeCount = parseInt(likeCountElem.textContent.replace('x', ''), 10);
|
let prevLikeCount = parseInt(likeCountElem.textContent.replace('x', ''), 10);
|
||||||
let likeCountUpdate = Math.floor(prevLikeCount + likeCount);
|
let likeCountUpdate = Math.floor(prevLikeCount + likeCount);
|
||||||
let likeCountDiv = previousLikeContainer.querySelector('#tiktok-gift-repeat-count');
|
let likeCountDiv = previousLikeContainer.querySelector('#tiktok-gift-repeat-count');
|
||||||
|
|
||||||
likeCountDiv.innerText = `x${likeCountUpdate}`;
|
likeCountDiv.innerText = `x${likeCountUpdate}`;
|
||||||
|
|
||||||
const parent = liLikeContainer.parentElement;
|
const parent = liLikeContainer.parentElement;
|
||||||
if (parent) {
|
if (parent) {
|
||||||
parent.appendChild(liLikeContainer);
|
parent.appendChild(liLikeContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
// Get a reference to the template
|
// Get a reference to the template
|
||||||
|
|||||||
Reference in New Issue
Block a user