From fcda6f8d32e27a26b41ca690a69dc6e2fc778f74 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 4 Jun 2025 11:33:10 -0700 Subject: [PATCH] Fix lint errors --- src-web/components/GrpcRequestPane.tsx | 1 - src-web/components/HttpRequestPane.tsx | 3 ++- src-web/components/RequestMethodDropdown.tsx | 16 ++++++++++------ src-web/components/WebsocketRequestPane.tsx | 4 +--- src-web/components/WebsocketResponsePane.tsx | 7 +++---- src-web/components/core/HttpMethodTag.tsx | 3 ++- .../responseViewers/EventStreamViewer.tsx | 4 ++-- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src-web/components/GrpcRequestPane.tsx b/src-web/components/GrpcRequestPane.tsx index 6b14bc2a..0d89533f 100644 --- a/src-web/components/GrpcRequestPane.tsx +++ b/src-web/components/GrpcRequestPane.tsx @@ -176,7 +176,6 @@ export function GrpcRequestPane({ { - await patchModel(request, { method }); - }, []); + const handleChange = useCallback( + async (method: string) => { + await patchModel(request, { method }); + }, + [request], + ); const itemsAfter = useMemo( () => [ @@ -57,7 +61,7 @@ export const RequestMethodDropdown = memo(function RequestMethodDropdown({ }, }, ], - [], + [handleChange], ); return ( @@ -68,7 +72,7 @@ export const RequestMethodDropdown = memo(function RequestMethodDropdown({ onChange={handleChange} > ); diff --git a/src-web/components/WebsocketRequestPane.tsx b/src-web/components/WebsocketRequestPane.tsx index c41c7e50..959a7cbb 100644 --- a/src-web/components/WebsocketRequestPane.tsx +++ b/src-web/components/WebsocketRequestPane.tsx @@ -54,10 +54,9 @@ const TAB_DESCRIPTION = 'description'; const nonActiveRequestUrlsAtom = atom((get) => { const activeRequestId = get(activeRequestIdAtom); const requests = get(allRequestsAtom); - const urls = requests + return requests .filter((r) => r.id !== activeRequestId) .map((r): GenericCompletionOption => ({ type: 'constant', label: r.url })); - return urls; }); const memoNotActiveRequestUrlsAtom = deepEqualAtom(nonActiveRequestUrlsAtom); @@ -227,7 +226,6 @@ export function WebsocketRequestPane({ style, fullHeight, className, activeReque onUrlChange={handleUrlChange} forceUpdateKey={forceUpdateKey} isLoading={activeResponse != null && activeResponse.state !== 'closed'} - method={null} /> copyToClipboard(formattedMessage.data ?? '')} + onClick={() => copyToClipboard(formattedMessage ?? '')} /> )} @@ -183,7 +182,7 @@ export function WebsocketResponsePane({ activeRequest }: Props) { ) : ( ; + if (formatted == null) return null; + return ; } function EventRow({