Skip to content

Commit

Permalink
format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abrulic1 committed Oct 31, 2024
1 parent 6239506 commit e59d174
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/client/hooks/useDevServerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const updateRouteInfo = (
const { data, type } = event
const { id, ...rest } = data
// Get existing route
const existingRouteInfo = !includeServerInfo ? routes?.[id] : routes?.[id] ?? server?.routes?.[id]
const existingRouteInfo = !includeServerInfo ? routes?.[id] : (routes?.[id] ?? server?.routes?.[id])
let newRouteData = [...(existingRouteInfo?.[type === "loader" ? "loaders" : "actions"] || []), rest]
// Makes sure there are no more than 20 entries per loader/action
newRouteData = cutArrayToLastN(newRouteData, 20)
Expand All @@ -40,10 +40,10 @@ const updateRouteInfo = (
highestExecutionTime: max,
averageExecutionTime: Number(Number(total / newRouteData.length).toFixed(2)),
loaderTriggerCount: type === "loader" ? loaderTriggerCount + 1 : loaderTriggerCount,
loaders: type === "loader" ? newRouteData : existingRouteInfo?.loaders ?? [],
actions: type === "action" ? newRouteData : existingRouteInfo?.actions ?? [],
lastLoader: type === "loader" ? rest : existingRouteInfo?.lastLoader ?? {},
lastAction: type === "action" ? rest : existingRouteInfo?.lastAction ?? {},
loaders: type === "loader" ? newRouteData : (existingRouteInfo?.loaders ?? []),
actions: type === "action" ? newRouteData : (existingRouteInfo?.actions ?? []),
lastLoader: type === "loader" ? rest : (existingRouteInfo?.lastLoader ?? {}),
lastAction: type === "action" ? rest : (existingRouteInfo?.lastAction ?? {}),
actionTriggerCount: type === "action" ? actionTriggerCount + 1 : actionTriggerCount,
}
}
Expand Down

0 comments on commit e59d174

Please sign in to comment.