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