mirror of
https://github.com/zadam/trilium.git
synced 2026-01-03 05:04:23 +01:00
fix(table_of_contents): not showing on first render of read-only notes
This commit is contained in:
parent
6d80323a76
commit
c23fe7cf13
@ -1177,7 +1177,7 @@ export function useContentElement(noteContext: NoteContext | null | undefined) {
|
||||
const requestId = ++requestIdRef.current;
|
||||
noteContext?.getContentElement().then(contentElement => {
|
||||
// Prevent stale async.
|
||||
if (requestId !== requestIdRef.current) return;
|
||||
if (!contentElement || requestId !== requestIdRef.current) return;
|
||||
setContentElement(contentElement?.[0] ?? null);
|
||||
forceUpdate(v => v + 1);
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user