File tree Expand file tree Collapse file tree
packages/gitbook/src/components/DocumentView/Integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,13 +11,12 @@ import { renderIntegrationUi } from './server-actions';
1111
1212export async function IntegrationBlock ( props : BlockProps < DocumentBlockIntegration > ) {
1313 const { block, context, style } = props ;
14- const { spaceId } = props . block . data
1514
1615 if ( ! context . contentContext ) {
1716 throw new Error ( 'Expected a content context to render an block' ) ;
1817 }
1918
20- if ( ! context . contentContext . space && ! spaceId ) {
19+ if ( ! context . contentContext . space && ! block . meta ?. spaceId ) {
2120 throw new Error ( 'integration block requires a spaceId from the context or API' ) ;
2221 }
2322
@@ -29,7 +28,7 @@ export async function IntegrationBlock(props: BlockProps<DocumentBlockIntegratio
2928 type : 'document' ,
3029 // When the block originates from a cross-space reusable content, the server adds a spaceId so the integration is
3130 // looked up in the correct source space.
32- spaceId : spaceId ?? context . contentContext . space . id ,
31+ spaceId : block . meta ?. spaceId ?? context . contentContext . space . id ,
3332 editable : false ,
3433 theme : 'light' , // TODO: how to handle this without moving rendering to the client side?
3534 } ,
You can’t perform that action at this time.
0 commit comments