From f44370009cc8895de0a061c4d05957c1fc7e1065 Mon Sep 17 00:00:00 2001 From: Oliver Eggert Date: Mon, 24 Nov 2025 22:46:41 -0800 Subject: [PATCH] fix hydration and browser navigation errors --- resources/dev-tools/websocket-api-tool.page.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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); };