Public Access
1
0

fix: update likes counter, metadata alignment

This commit is contained in:
2025-08-25 20:06:15 -04:00
parent 989e10a5ba
commit 8e2d448618
2 changed files with 23 additions and 14 deletions

View File

@@ -9,7 +9,13 @@ document.addEventListener('DOMContentLoaded', () => {
// Function to update the UI based on liked state and count
const updateUI = (isLiked, count) => {
if (likeCountSpan) {
likeCountSpan.textContent = count;
if (count === 0) {
likeCountSpan.textContent = 'No likes';
} else if (count === 1) {
likeCountSpan.textContent = '1 like';
} else {
likeCountSpan.textContent = `${count} likes`;
}
}
if (isLiked) {
likeIcon.classList.add('liked');