Skip to content

Commit 447459f

Browse files
committed
Revert "Fix broken pending block fetching"
This reverts commit bf8c9c5.
1 parent 882d36e commit 447459f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/routes/page.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ export async function pageRoute(req: HandlerRequest) {
1616
let allBlockKeys;
1717

1818
while (true) {
19+
allBlockKeys = Object.keys(allBlocks);
1920

20-
allBlockKeys = allBlocks[pageId!].value.content
21+
const pendingBlocks = allBlockKeys.flatMap((blockId) => {
22+
const block = allBlocks[blockId];
23+
const content = block.value && block.value.content;
2124

22-
const pendingBlocks = allBlockKeys!.filter((blockId) => {
23-
return !allBlocks.hasOwnProperty(blockId)
25+
return content && block.value.type !== "page"
26+
? content.filter((id: string) => !allBlocks[id])
27+
: [];
2428
});
2529

2630
if (!pendingBlocks.length) {

0 commit comments

Comments
 (0)