From b0c74496a66449c4c63d9fb04fec268fe407ada8 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 3 Aug 2026 12:28:28 +0530 Subject: [PATCH] fix: resolve 4 bugs in BiblioDrift --- frontend/js/community-stories.js | 2 +- frontend/js/db.js | 2 +- frontend/js/landing-contributors.js | 2 +- frontend/js/nearby-bookstores.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/js/community-stories.js b/frontend/js/community-stories.js index 0dd614763..528ffb73a 100644 --- a/frontend/js/community-stories.js +++ b/frontend/js/community-stories.js @@ -49,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => { } ]; - let stories = JSON.parse(localStorage.getItem('bibliodrift_community_stories')) || defaultStories; + let stories = (JSON.parse(localStorage.getItem('bibliodrift_community_stories') ?? "null") ?? null) || defaultStories; // Save to local storage const saveStories = () => { diff --git a/frontend/js/db.js b/frontend/js/db.js index 383f17f32..1c4de7b40 100644 --- a/frontend/js/db.js +++ b/frontend/js/db.js @@ -12,7 +12,7 @@ async function getPendingLibrarySyncCount(userId) { if (!window.db?.syncQueue) return 0; - if (userId == null) { + if (userId === null) { return await window.db.syncQueue.count(); } return await window.db.syncQueue.where('userId').equals(userId).count(); diff --git a/frontend/js/landing-contributors.js b/frontend/js/landing-contributors.js index a3ee0378e..81f269ce1 100644 --- a/frontend/js/landing-contributors.js +++ b/frontend/js/landing-contributors.js @@ -334,6 +334,6 @@ } refreshContributorSource(false); - setInterval(()=> refreshContributorSource(true), REFRESH_INTERVAL_MS); + clearInterval(window.__interval); window.__interval = setInterval(()=> refreshContributorSource(true), REFRESH_INTERVAL_MS); }); })(); diff --git a/frontend/js/nearby-bookstores.js b/frontend/js/nearby-bookstores.js index 16e813e04..dfe5f7a2a 100644 --- a/frontend/js/nearby-bookstores.js +++ b/frontend/js/nearby-bookstores.js @@ -142,7 +142,7 @@ function handleLocationSuccess(position) { const longitude = position.coords.longitude; - locationStatus.innerHTML = ` + locationStatus.textContent = `