From 01978dabf0d932a2315808774ad53b73c270cbad Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 10 Dec 2025 19:05:33 +0200 Subject: [PATCH] fix(breadcrumb_badges): doesn't refresh when switching editability --- apps/client/src/widgets/react/hooks.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 38f0a1967..65448eb92 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -845,6 +845,8 @@ export function useGlobalShortcut(keyboardShortcut: string | null | undefined, h */ export function useIsNoteReadOnly(note: FNote | null | undefined, noteContext: NoteContext | undefined) { const [ isReadOnly, setIsReadOnly ] = useState(undefined); + const [ readOnlyAttr ] = useNoteLabelBoolean(note, "readOnly"); + const [ autoReadOnlyDisabledAttr ] = useNoteLabelBoolean(note, "autoReadOnlyDisabled"); const enableEditing = useCallback((enabled = true) => { if (noteContext?.viewScope) { @@ -859,7 +861,7 @@ export function useIsNoteReadOnly(note: FNote | null | undefined, noteContext: N setIsReadOnly(readOnly); }); } - }, [ note, noteContext, noteContext?.viewScope ]); + }, [ note, noteContext, noteContext?.viewScope, readOnlyAttr, autoReadOnlyDisabledAttr ]); useTriliumEvent("readOnlyTemporarilyDisabled", ({noteContext: eventNoteContext}) => { if (noteContext?.ntxId === eventNoteContext.ntxId) {