Skip to content

Commit b607868

Browse files
committed
fix: use block.meta instead of block.data
1 parent e4ea797 commit b607868

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/gitbook/src/components/DocumentView/Integration/IntegrationBlock.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import { renderIntegrationUi } from './server-actions';
1111

1212
export 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
},

0 commit comments

Comments
 (0)