Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ Tell me: what is stirring in you today?`,
timestamp = rawMessage.timestamp;
} else if (typeof rawMessage.timestamp === 'string') {
const parsed = Date.parse(rawMessage.timestamp);
if (!isNaN(parsed)) {
if (!Number.isNaN(parsed)) {
timestamp = parsed;
}
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/community-stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
];

let stories = JSON.parse(localStorage.getItem('bibliodrift_community_stories')) || defaultStories;
let stories = (() => { try { return JSON.parse(localStorage.getItem('bibliodrift_community_stories')) } catch { return null } })() || defaultStories;

// Save to local storage
const saveStories = () => {
Expand Down
23 changes: 1 addition & 22 deletions sw.js/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,4 @@ const ASSETS_TO_CACHE = [
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
console.log('Caching essential UI sanctuary assets...');
return cache.addAll(ASSETS_TO_CACHE);
})
);
});

// Fetch Event: Cache-First strategy for core layout files
self.addEventListener('fetch', (event) => {
// Only intercept local GET requests
if (event.request.method !== 'GET' || !event.request.url.startsWith(self.location.origin)) {
return;
}

event.respondWith(
caches.match(event.request).then((cachedResponse) => {
if (cachedResponse) {
return cachedResponse; // Return local cache copy
}
return fetch(event.request); // Fallback to network
})
);
});
.catch(err => console.error(err))