chore: Disable story updates and preloading logic

This commit is contained in:
2025-11-19 17:46:27 +00:00
parent 667c2c5eaf
commit 83cb6fc0ae

View File

@@ -14,24 +14,24 @@ function Feed({ updateCache }) {
.then(
(result) => {
const updated = !stories || stories[0].id !== result.stories[0].id;
console.log('updated:', updated);
console.log('New stories available:', updated);
setStories(result.stories);
localStorage.setItem('stories', JSON.stringify(result.stories));
if (!updated) return;
if (updated) {
localForage.clear();
result.stories.forEach((x, i) => {
fetch('/api/' + x.id)
.then(res => res.json())
.then(result => {
localForage.setItem(x.id, result.story)
.then(console.log('preloaded', x.id, x.title));
updateCache(x.id, result.story);
}, error => {}
);
});
}
//setStories(result.stories);
//localStorage.setItem('stories', JSON.stringify(result.stories));
//localForage.clear();
//result.stories.forEach((x, i) => {
// fetch('/api/' + x.id)
// .then(res => res.json())
// .then(result => {
// localForage.setItem(x.id, result.story)
// .then(console.log('preloaded', x.id, x.title));
// updateCache(x.id, result.story);
// }, error => {}
// );
//});
},
(error) => {
setError(true);