fix(web): refresh memo detail cache after editor save
This commit is contained in:
parent
bbdc998646
commit
333c9df233
1 changed files with 5 additions and 0 deletions
|
|
@ -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) }));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue