diff --git a/packages/insomnia/src/ui/hooks/use-close-connection.ts b/packages/insomnia/src/ui/hooks/use-close-connection.ts index 7cce8162167..eb350b98559 100644 --- a/packages/insomnia/src/ui/hooks/use-close-connection.ts +++ b/packages/insomnia/src/ui/hooks/use-close-connection.ts @@ -2,13 +2,13 @@ import { useCallback, useEffect } from 'react'; import * as models from '../../models'; import { isGrpcRequestId } from '../../models/grpc-request'; -import { isEventStreamRequest, isRequestId } from '../../models/request'; +import { isEventStreamRequest, isGraphqlSubscriptionRequest, isRequestId } from '../../models/request'; import { isWebSocketRequestId } from '../../models/websocket-request'; import uiEventBus, { UIEventType } from '../eventBus'; export const useCloseConnection = () => { // close websocket&grpc&SSE connections - const closeConnection = useCallback((ids: 'all' | string[]) => { + const closeConnection = useCallback((_: string, ids: 'all' | string[]) => { if (ids === 'all') { window.main.webSocket.closeAll(); window.main.grpc.closeAll(); @@ -19,11 +19,13 @@ export const useCloseConnection = () => { ids.forEach(async id => { if (isGrpcRequestId(id)) { window.main.grpc.cancel(id); - } else if (isWebSocketRequestId()) { + } else if (isWebSocketRequestId(id)) { window.main.webSocket.close({ requestId: id }); } else if (isRequestId(id)) { const request = await models.request.getById(id); if (request && isEventStreamRequest(request)) { + window.main.curl.close({ requestId: id }); + } else if (request && isGraphqlSubscriptionRequest(request)) { window.main.webSocket.close({ requestId: id }); } }