Skip to content

Build your personal knowledge base with Trilium Notes

Update apps/client/src/widgets/react/hooks.tsx

Vedansh Bodkhe52f2e800e781
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index 40c5df720e..2dd5de4d5f 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -1215,11 +1215,11 @@ export function useNoteTitle(noteId: string | undefined, parentNoteId: string |
});
// React to external changes.
- useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
- if (loadResults.isNoteReloaded(noteId)) {
+ useTriliumEvent("entitiesReloaded", useCallback(({ loadResults }) => {
+ if (loadResults.isNoteReloaded(noteId) || (parentNoteId && loadResults.getBranchRows().some(b => b.noteId === noteId && b.parentNoteId === parentNoteId))) {
refresh();
}
- });
+ }, [noteId, parentNoteId, refresh]));
return title;
}