Commit 333c9df2 authored by Steven's avatar Steven

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

parent bbdc9986
...@@ -87,6 +87,11 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({ ...@@ -87,6 +87,11 @@ const MemoEditorImpl: React.FC<MemoEditorProps> = ({
queryClient.invalidateQueries({ queryKey: userKeys.stats() }), 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 this was a comment, also invalidate the comments query for the parent memo
if (parentMemoName) { if (parentMemoName) {
invalidationPromises.push(queryClient.invalidateQueries({ queryKey: memoKeys.comments(parentMemoName) })); invalidationPromises.push(queryClient.invalidateQueries({ queryKey: memoKeys.comments(parentMemoName) }));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment