Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(markdown): syncing doesn't work on read-only notes
Elian Doran0335ece20b44
diff --git a/apps/client/src/widgets/type_widgets/code/Code.tsx b/apps/client/src/widgets/type_widgets/code/Code.tsxindex 951ebcdc19..6c74dc8219 100644--- a/apps/client/src/widgets/type_widgets/code/Code.tsx+++ b/apps/client/src/widgets/type_widgets/code/Code.tsx@@ -36,7 +36,7 @@ export interface EditableCodeProps extends TypeWidgetProps, Omit<CodeEditorPropseditorRef?: Ref<VanillaCodeMirror>;}-export function ReadOnlyCode({ note, viewScope, ntxId, parentComponent }: TypeWidgetProps) {+export function ReadOnlyCode({ note, viewScope, ntxId, parentComponent, editorRef }: TypeWidgetProps & { editorRef?: Ref<VanillaCodeMirror> }) {const [ content, setContent ] = useState("");const blob = useNoteBlob(note);const [ noteTabWidth ] = useNoteLabelInt(note, "tabWidth");@@ -57,6 +57,7 @@ export function ReadOnlyCode({ note, viewScope, ntxId, parentComponent }: TypeWireturn (<CodeEditorntxId={ntxId} parentComponent={parentComponent}+ editorRef={editorRef}className="note-detail-readonly-code-content"content={content}mime={note.mime}