mirror of
https://github.com/zadam/trilium.git
synced 2025-12-31 11:44:23 +01:00
fix(breadcrumbs): not reacting to protected session being started
This commit is contained in:
parent
30cc221eca
commit
b5af513371
@ -1090,7 +1090,7 @@ export function useNoteTitle(noteId: string | undefined, parentNoteId: string |
|
||||
const [ title, setTitle ] = useState<string>();
|
||||
const requestIdRef = useRef(0);
|
||||
|
||||
useEffect(() => {
|
||||
const refresh = useCallback(() => {
|
||||
const requestId = ++requestIdRef.current;
|
||||
if (!noteId) return;
|
||||
tree.getNoteTitle(noteId, parentNoteId).then(title => {
|
||||
@ -1099,6 +1099,15 @@ export function useNoteTitle(noteId: string | undefined, parentNoteId: string |
|
||||
});
|
||||
}, [ noteId, parentNoteId ]);
|
||||
|
||||
useEffect(() => {
|
||||
refresh();
|
||||
}, [ refresh ]);
|
||||
|
||||
// React to changes in protected session.
|
||||
useTriliumEvent("protectedSessionStarted", () => {
|
||||
refresh();
|
||||
});
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user