fix(web): refresh memo detail cache after editor save

This commit is contained in:
Steven 2026-02-25 20:03:09 +08:00
parent bbdc998646
commit 333c9df233
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,11 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({
queryClient.invalidateQueries({ queryKey: userKeys.stats() }),
];
// Ensure memo detail pages don't keep stale cached content after edits.
if (memoName) {
invalidationPromises.push(queryClient.invalidateQueries({ queryKey: memoKeys.detail(memoName) }));
}
// If this was a comment, also invalidate the comments query for the parent memo
if (parentMemoName) {
invalidationPromises.push(queryClient.invalidateQueries({ queryKey: memoKeys.comments(parentMemoName) }));