This commit is contained in:
2025-11-19 19:17:33 +00:00
parent e18aaad741
commit 845d87ec55

View File

@@ -35,7 +35,7 @@ function Feed({ updateCache }) {
const fullStory = storyResult.story; const fullStory = storyResult.story;
await localForage.setItem(fullStory.id, fullStory); await localForage.setItem(fullStory.id, fullStory);
console.log('preloaded', fullStory.id, fullStory.title); console.log('Preloaded story:', fullStory.id, fullStory.title);
updateCache(fullStory.id, fullStory); updateCache(fullStory.id, fullStory);
currentStories.unshift(newStory); currentStories.unshift(newStory);
@@ -47,6 +47,7 @@ function Feed({ updateCache }) {
const finalStories = currentStories.slice(0, newApiStories.length); const finalStories = currentStories.slice(0, newApiStories.length);
const removedStories = currentStories.slice(newApiStories.length); const removedStories = currentStories.slice(newApiStories.length);
for (const story of removedStories) { for (const story of removedStories) {
console.log('Removed story:', story.id, story.title);
localForage.removeItem(story.id); localForage.removeItem(story.id);
} }
@@ -59,8 +60,6 @@ function Feed({ updateCache }) {
); );
}, [updateCache]); }, [updateCache]);
console.log(stories);
return ( return (
<div className='container'> <div className='container'>
<Helmet> <Helmet>