small bug fix

This commit is contained in:
Nuno Coração
2023-12-06 22:08:16 +00:00
parent 8f126777ad
commit d613121b76
3 changed files with 12 additions and 7 deletions

View File

@@ -18,9 +18,11 @@ if (typeof auth !== 'undefined') {
viewsCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
toggleLoaders(node)
node.innerText = numberWithCommas(data.views)
} else {
node.innerText = 0
}
toggleLoaders(node)
})
}
@@ -28,9 +30,12 @@ if (typeof auth !== 'undefined') {
likesCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
toggleLoaders(node)
node.innerText = numberWithCommas(data.likes)
} else {
node.innerText = 0
}
toggleLoaders(node)
})
}