@@ -1518,33 +1518,30 @@ async function renderToHTMLOrFlightImpl(
1518
1518
ctx,
1519
1519
} )
1520
1520
1521
- if ( actionRequestResult ) {
1522
- if ( actionRequestResult . type === 'not-found' ) {
1523
- const notFoundLoaderTree = createNotFoundLoaderTree ( loaderTree )
1524
- res . statusCode = 404
1525
- const stream = await renderToStreamWithTracing (
1526
- requestStore ,
1527
- req ,
1528
- res ,
1529
- ctx ,
1530
- workStore ,
1531
- notFoundLoaderTree ,
1532
- formState ,
1533
- postponedState
1534
- )
1521
+ if ( actionRequestResult . type === 'not-found' ) {
1522
+ const notFoundLoaderTree = createNotFoundLoaderTree ( loaderTree )
1523
+ res . statusCode = 404
1524
+ const stream = await renderToStreamWithTracing (
1525
+ requestStore ,
1526
+ req ,
1527
+ res ,
1528
+ ctx ,
1529
+ workStore ,
1530
+ notFoundLoaderTree ,
1531
+ formState ,
1532
+ postponedState
1533
+ )
1535
1534
1536
- return new RenderResult ( stream , { metadata } )
1537
- } else if ( actionRequestResult . type === 'done' ) {
1538
- if ( actionRequestResult . result ) {
1539
- actionRequestResult . result . assignMetadata ( metadata )
1540
- return actionRequestResult . result
1541
- } else if ( actionRequestResult . formState ) {
1542
- formState = actionRequestResult . formState
1543
- }
1544
- } else if ( actionRequestResult . type === 'not-an-action' ) {
1545
- // TODO: previously, these would be a 'done' with no `result` and no `formState`,
1546
- // so they'd fall through the branch above. Why does that work?
1535
+ return new RenderResult ( stream , { metadata } )
1536
+ } else if ( actionRequestResult . type === 'done' ) {
1537
+ if ( actionRequestResult . result ) {
1538
+ actionRequestResult . result . assignMetadata ( metadata )
1539
+ return actionRequestResult . result
1540
+ } else if ( actionRequestResult . formState ) {
1541
+ formState = actionRequestResult . formState
1547
1542
}
1543
+ } else if ( actionRequestResult . type === 'not-an-action' ) {
1544
+ // nothing to do here.
1548
1545
}
1549
1546
}
1550
1547
0 commit comments