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