Skip to content

Commit d0f9146

Browse files
committed
Fix missing blocks while keeping base page content
1 parent 447459f commit d0f9146

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/routes/page.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ export async function pageRoute(req: HandlerRequest) {
2222
const block = allBlocks[blockId];
2323
const content = block.value && block.value.content;
2424

25-
return content && block.value.type !== "page"
26-
? content.filter((id: string) => !allBlocks[id])
27-
: [];
25+
if (!content || (block.value.type === "page" && blockId !== pageId!)) {
26+
// skips pages other than the requested page
27+
return [];
28+
}
29+
30+
return content.filter((id: string) => !allBlocks[id]);
2831
});
2932

3033
if (!pendingBlocks.length) {

0 commit comments

Comments
 (0)