File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,21 @@ const Inspector: React.FC<IProps> = (props) => {
76
76
jsonrpc : "2.0" ,
77
77
method : props . openrpcMethodObject . name ,
78
78
params : json . params ,
79
- id,
79
+ id : id . toString ( ) ,
80
80
} ) ;
81
81
}
82
82
// eslint-disable-next-line react-hooks/exhaustive-deps
83
83
} , [ ] ) ;
84
+ useEffect ( ( ) => {
85
+ if ( json ) {
86
+ setJson ( {
87
+ ...json ,
88
+ jsonrpc : "2.0" ,
89
+ id : id . toString ( ) ,
90
+ } ) ;
91
+ }
92
+ // eslint-disable-next-line react-hooks/exhaustive-deps
93
+ } , [ id ] ) ;
84
94
85
95
useEffect ( ( ) => {
86
96
if ( props . url ) {
@@ -94,7 +104,7 @@ const Inspector: React.FC<IProps> = (props) => {
94
104
incrementId ( ) ;
95
105
try {
96
106
const result = await client . request ( json . method , json . params ) ;
97
- setResults ( { jsonrpc : "2.0" , result } ) ;
107
+ setResults ( { jsonrpc : "2.0" , result, id } ) ;
98
108
} catch ( e ) {
99
109
setError ( e ) ;
100
110
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import useDarkMode from "use-dark-mode";
3
3
import { monaco , ControlledEditor , Monaco } from "@monaco-editor/react" ;
4
4
import { MethodObject } from "@open-rpc/meta-schema" ;
5
5
import useWindowSize from "@rehooks/window-size" ;
6
- import { addDiagnostics } from "@etclabscore/monaco-add-json-schema-diagnostics"
6
+ import { addDiagnostics } from "@etclabscore/monaco-add-json-schema-diagnostics" ;
7
7
8
8
interface IProps {
9
9
onChange ?: ( newValue : any ) => void ;
You can’t perform that action at this time.
0 commit comments