diff --git a/resources/dev-tools/websocket-api-tool.page.tsx b/resources/dev-tools/websocket-api-tool.page.tsx index 5e06959956..e491cafd34 100644 --- a/resources/dev-tools/websocket-api-tool.page.tsx +++ b/resources/dev-tools/websocket-api-tool.page.tsx @@ -55,8 +55,8 @@ export function WebsocketApiTool() { const getInitialMethod = (): CommandMethod => { for (const group of (commandList as CommandGroup[])) { for (const method of group.methods) { - if (slug.slice(1) === slugify(method.name) || params.req?.command == method.body.command) { - return method; + if (params.req?.command === method.body.command) { + return method } } } @@ -74,6 +74,19 @@ export function WebsocketApiTool() { ); streamPausedRef.current = streamPaused; + useEffect(() => { + if (slug) { + for (const group of (commandList as CommandGroup[])) { + for (const method of group.methods) { + if (slug.slice(1) === slugify(method.name)) { + setMethod(method) + return + } + } + } + } + }, [slug]) + const handleCurrentBodyChange = (value: any) => { setCurrentBody(value); };