From 0657a1ef5b52cffcca99d48eecab7e17e11e0d34 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 1 Jun 2024 08:48:54 +0800 Subject: [PATCH] chore: fix memo editor cache --- web/src/components/MemoEditor/index.tsx | 1 + web/src/pages/MemoDetail.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index 03c61738f..22daa44e1 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -349,6 +349,7 @@ const MemoEditor = (props: Props) => { toast.error(error.details); } + localStorage.removeItem(contentCacheKey); setState((state) => { return { ...state, diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 5759f4c93..5c059b27f 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -66,6 +66,7 @@ const MemoDetail = () => { placeholder: t("editor.add-your-comment-here"), parentMemoName: memo.name, onConfirm: handleCommentCreated, + cacheKey: `${memo.name}-${memo.updateTime}-comment`, }); };