Skip to content

Commit 882d36e

Browse files
authored
Merge pull request #52 from JhumanJ/master
Fix broken pending block fetching
2 parents 605a111 + bf8c9c5 commit 882d36e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/routes/page.ts

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

1818
while (true) {
19-
allBlockKeys = Object.keys(allBlocks);
2019

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

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

3026
if (!pendingBlocks.length) {

0 commit comments

Comments
 (0)