From 52ed1750ac53c482deae466caea1ff180c61ca1b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 17 Jan 2026 20:52:53 +0200 Subject: [PATCH] fix(sql_console): runtime error for inline title --- apps/client/src/widgets/layout/InlineTitle.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/client/src/widgets/layout/InlineTitle.tsx b/apps/client/src/widgets/layout/InlineTitle.tsx index b0e7e4e8a..907090253 100644 --- a/apps/client/src/widgets/layout/InlineTitle.tsx +++ b/apps/client/src/widgets/layout/InlineTitle.tsx @@ -23,12 +23,12 @@ const supportedNoteTypes = new Set([ export default function InlineTitle() { const { note, parentComponent, viewScope } = useNoteContext(); const type = useNoteProperty(note, "type"); - const [ shown, setShown ] = useState(shouldShow(note?.noteId, type, viewScope)); + const [ shown, setShown ] = useState(shouldShow(note, type, viewScope)); const containerRef = useRef(null); const [ titleHidden, setTitleHidden ] = useState(false); useLayoutEffect(() => { - setShown(shouldShow(note?.noteId, type, viewScope)); + setShown(shouldShow(note, type, viewScope)); }, [ note, type, viewScope ]); useLayoutEffect(() => { @@ -70,10 +70,10 @@ export default function InlineTitle() { ); } -function shouldShow(note: FNote, type: NoteType | undefined, viewScope: ViewScope | undefined) { +function shouldShow(note: FNote | null | undefined, type: NoteType | undefined, viewScope: ViewScope | undefined) { if (viewScope?.viewMode !== "default") return false; - if (note.noteId?.startsWith("_options")) return true; - if (note.isTriliumSqlite()) return false; + if (note?.noteId?.startsWith("_options")) return true; + if (note?.isTriliumSqlite()) return false; return type && supportedNoteTypes.has(type); }