Merge pull request #1098 from nunocoracao/dev

🔖 v2.47.1 - Small bug fix
This commit is contained in:
Nuno Coração 2023-12-06 22:09:34 +00:00 committed by GitHub
commit ea8ad8ba7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View file

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

View file

@ -1,10 +1,10 @@
<span> <span>
<button id="likes_button" <button id="button_likes"
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400" class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
onclick="process_article()"> onclick="process_article()">
<span id="likes_button_heart" style="display:none" class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }} </span> <span id="button_likes_heart" style="display:none" class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }} </span>
<span id="likes_button_emtpty_heart" class="inline-block align-text-bottom">{{ partial "icon.html" "heart-empty" }}</span> <span id="button_likes_emtpty_heart" class="inline-block align-text-bottom">{{ partial "icon.html" "heart-empty" }}</span>
<span id="likes_button_text">&nbsp;Like</span> <span id="button_likes_text">&nbsp;Like</span>
</button> </button>
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View file

@ -1,6 +1,6 @@
{ {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.47.0", "version": "2.47.1",
"description": "Blowfish theme for Hugo", "description": "Blowfish theme for Hugo",
"scripts": { "scripts": {
"fullinstall": "npm run preinstall && npm install && npm run postinstall", "fullinstall": "npm run preinstall && npm install && npm run postinstall",