Skip to content

Commit

Permalink
refresh fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedorn committed Feb 3, 2024
1 parent b3ddb44 commit f5fda9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export async function cachePost(id: number) {
if (cachedPostIndex === -1) {
const newPosts = [{ ...post, cached_slug: slug }, ...posts]
await POSTS.put('INDEX', JSON.stringify(newPosts))
} else {
posts[cachedPostIndex] = { ...post, cached_slug: slug, tags: post.tags[0] } as PostType
await POSTS.put('INDEX', JSON.stringify(posts))
}
return slug
}
Expand Down

0 comments on commit f5fda9d

Please sign in to comment.