Skip to content

Commit 677ca54

Browse files
ioedeveloperAniket-Engg
authored andcommitted
Fixed parsing witness inputs
1 parent e16b621 commit 677ca54

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/circuit-compiler/src/app/components/witness.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ export function WitnessSection ({ plugin, signalInputs, status }: {plugin: Circo
99
const [witnessValues, setWitnessValues] = useState<Record<string, string>>({})
1010

1111
const handleSignalInput = (e: any) => {
12+
let value = e.target.value
13+
14+
try {
15+
value = JSON.parse(value)
16+
} catch (e) {
17+
// do nothing
18+
}
1219
setWitnessValues({
1320
...witnessValues,
14-
[e.target.name]: e.target.value
21+
[e.target.name]: value
1522
})
1623
}
1724

0 commit comments

Comments
 (0)