mirror of https://github.com/usememos/memos.git
fix(web): refresh memo detail cache after editor save
This commit is contained in:
parent
bbdc998646
commit
333c9df233
|
|
@ -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) }));
|
||||
|
|
|
|||
Loading…
Reference in New Issue