Unverified Commit 678b4879 authored by Zack Tanner's avatar Zack Tanner Committed by GitHub

remove unused argument to applyPatch (#69376)

While refactoring router stuff, I noticed `flightSegmentPath` wasn't
being used by `applyPatch`.
parent 7f57d4b1
...@@ -11,8 +11,7 @@ import { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-par ...@@ -11,8 +11,7 @@ import { addRefreshMarkerToActiveParallelSegments } from './refetch-inactive-par
*/ */
function applyPatch( function applyPatch(
initialTree: FlightRouterState, initialTree: FlightRouterState,
patchTree: FlightRouterState, patchTree: FlightRouterState
flightSegmentPath: FlightSegmentPath
): FlightRouterState { ): FlightRouterState {
const [initialSegment, initialParallelRoutes] = initialTree const [initialSegment, initialParallelRoutes] = initialTree
const [patchSegment, patchParallelRoutes] = patchTree const [patchSegment, patchParallelRoutes] = patchTree
...@@ -34,8 +33,7 @@ function applyPatch( ...@@ -34,8 +33,7 @@ function applyPatch(
if (isInPatchTreeParallelRoutes) { if (isInPatchTreeParallelRoutes) {
newParallelRoutes[key] = applyPatch( newParallelRoutes[key] = applyPatch(
initialParallelRoutes[key], initialParallelRoutes[key],
patchParallelRoutes[key], patchParallelRoutes[key]
flightSegmentPath
) )
} else { } else {
newParallelRoutes[key] = initialParallelRoutes[key] newParallelRoutes[key] = initialParallelRoutes[key]
...@@ -87,11 +85,7 @@ export function applyRouterStatePatchToTree( ...@@ -87,11 +85,7 @@ export function applyRouterStatePatchToTree(
// Root refresh // Root refresh
if (flightSegmentPath.length === 1) { if (flightSegmentPath.length === 1) {
const tree: FlightRouterState = applyPatch( const tree: FlightRouterState = applyPatch(flightRouterState, treePatch)
flightRouterState,
treePatch,
flightSegmentPath
)
addRefreshMarkerToActiveParallelSegments(tree, path) addRefreshMarkerToActiveParallelSegments(tree, path)
...@@ -109,11 +103,7 @@ export function applyRouterStatePatchToTree( ...@@ -109,11 +103,7 @@ export function applyRouterStatePatchToTree(
let parallelRoutePatch let parallelRoutePatch
if (lastSegment) { if (lastSegment) {
parallelRoutePatch = applyPatch( parallelRoutePatch = applyPatch(parallelRoutes[parallelRouteKey], treePatch)
parallelRoutes[parallelRouteKey],
treePatch,
flightSegmentPath
)
} else { } else {
parallelRoutePatch = applyRouterStatePatchToTree( parallelRoutePatch = applyRouterStatePatchToTree(
flightSegmentPath.slice(2), flightSegmentPath.slice(2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment