Skip to content

Commit 7cf6dcc

Browse files
authored
Merge pull request #3391 from XRPLF/ws-hydration-error
Fix WebSocket API Tool errors
2 parents 78fc4f4 + f443700 commit 7cf6dcc

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

resources/dev-tools/websocket-api-tool.page.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export function WebsocketApiTool() {
5555
const getInitialMethod = (): CommandMethod => {
5656
for (const group of (commandList as CommandGroup[])) {
5757
for (const method of group.methods) {
58-
if (slug.slice(1) === slugify(method.name) || params.req?.command == method.body.command) {
59-
return method;
58+
if (params.req?.command === method.body.command) {
59+
return method
6060
}
6161
}
6262
}
@@ -74,6 +74,19 @@ export function WebsocketApiTool() {
7474
);
7575
streamPausedRef.current = streamPaused;
7676

77+
useEffect(() => {
78+
if (slug) {
79+
for (const group of (commandList as CommandGroup[])) {
80+
for (const method of group.methods) {
81+
if (slug.slice(1) === slugify(method.name)) {
82+
setMethod(method)
83+
return
84+
}
85+
}
86+
}
87+
}
88+
}, [slug])
89+
7790
const handleCurrentBodyChange = (value: any) => {
7891
setCurrentBody(value);
7992
};

0 commit comments

Comments
 (0)