File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,18 @@ export async function pageRoute(req: HandlerRequest) {
16
16
let allBlockKeys ;
17
17
18
18
while ( true ) {
19
+ allBlockKeys = Object . keys ( allBlocks ) ;
19
20
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 ;
24
+
25
+ if ( ! content || ( block . value . type === "page" && blockId !== pageId ! ) ) {
26
+ // skips pages other than the requested page
27
+ return [ ] ;
28
+ }
21
29
22
- const pendingBlocks = allBlockKeys ! . filter ( ( blockId ) => {
23
- return ! allBlocks . hasOwnProperty ( blockId )
30
+ return content . filter ( ( id : string ) => ! allBlocks [ id ] ) ;
24
31
} ) ;
25
32
26
33
if ( ! pendingBlocks . length ) {
You can’t perform that action at this time.
0 commit comments