fix: defaults

This commit is contained in:
2026-03-16 16:40:50 +01:00
parent 3de9a33074
commit be0f743970

View File

@@ -109,13 +109,13 @@ export function LogosPage() {
[recollectionId] [recollectionId]
) )
const initialContent = useMemo( const initialContent = useMemo(() => {
() => if (!recollectionId || !activePageId) return undefined
recollectionId && activePageId const content = getLogosContentForPage(recollectionId, activePageId)
? getLogosContentForPage(recollectionId, activePageId) ?? undefined // BlockNote requires a non-empty array of blocks; use undefined for default empty doc.
: undefined, if (!content || !Array.isArray(content) || content.length === 0) return undefined
[recollectionId, activePageId, reloadKey] return content
) }, [recollectionId, activePageId, reloadKey])
const editor = useCreateBlockNote( const editor = useCreateBlockNote(
{ schema: logosSchema, initialContent }, { schema: logosSchema, initialContent },