From f5fda9d75becda775141781735e8f92f6c253b90 Mon Sep 17 00:00:00 2001 From: Bryce Dorn Date: Sat, 3 Feb 2024 20:33:57 +0100 Subject: [PATCH] refresh fix --- src/utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.ts b/src/utils.ts index 530c0cb..2fabca9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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 }