Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
markov00 committed Sep 9, 2024
1 parent 9897bd9 commit 0cce1fa
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,9 @@ export const InnerWorkspacePanel = React.memo(function InnerWorkspacePanel({
}
);
esTookTime.current = adapters.requests.getRequests().reduce((maxTime, { response }) => {
if (response === undefined) {
return maxTime;
}
const took =
(
response.json as {
rawResponse: estypes.SearchResponse | undefined;
}
)?.rawResponse?.took ?? 0;
(response?.json as { rawResponse: estypes.SearchResponse | undefined } | undefined)
?.rawResponse?.took ?? 0;

return Math.max(maxTime, took);
}, 0);
Expand Down

0 comments on commit 0cce1fa

Please sign in to comment.