From 0cce1fab80d11fce39167e1f95a177ebbcbafa5a Mon Sep 17 00:00:00 2001 From: Marco Vettorello Date: Mon, 9 Sep 2024 13:17:04 +0200 Subject: [PATCH] cleanup code --- .../editor_frame/workspace_panel/workspace_panel.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx index 5cd89006e2813..c38bfb2cc86f0 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx @@ -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);