Skip to content

Commit

Permalink
address github warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava committed Jul 25, 2024
1 parent a1bb6f2 commit f574fc9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/ui/app/src/api-playground/PlaygroundWebSocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const PlaygroundWebSocket: FC<PlaygroundWebSocketProps> = ({ websocket, t
useEffect(() => () => socket.current?.close(), []);

const selectedEnvironmentId = useSelectedEnvironmentId();
const baseUrl = resolveEnvironment(websocket, selectedEnvironmentId).baseUrl;

const startSession = useCallback(async () => {
return new Promise<boolean>((resolve) => {
Expand All @@ -56,12 +57,7 @@ export const PlaygroundWebSocket: FC<PlaygroundWebSocketProps> = ({ websocket, t

setError(null);

const url = buildRequestUrl(
resolveEnvironment(websocket, selectedEnvironmentId).baseUrl,
websocket.path,
formState.pathParameters,
formState.queryParameters,
);
const url = buildRequestUrl(baseUrl, websocket.path, formState.pathParameters, formState.queryParameters);

setConnectedState("opening");

Expand Down Expand Up @@ -113,7 +109,7 @@ export const PlaygroundWebSocket: FC<PlaygroundWebSocketProps> = ({ websocket, t
formState.queryParameters,
pushMessage,
websocket.auth,
resolveEnvironment(websocket, selectedEnvironmentId).baseUrl,
baseUrl,
websocket.path,
]);

Expand Down

0 comments on commit f574fc9

Please sign in to comment.