fix hydration and browser navigation errors

This commit is contained in:
Oliver Eggert
2025-11-24 22:46:41 -08:00
parent 78fc4f49e6
commit f44370009c

View File

@@ -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);
};