fix: defaults
This commit is contained in:
@@ -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 },
|
||||||
|
|||||||
Reference in New Issue
Block a user