Fix circom mismatch bug and compiler reset

pull/5370/head
ioedeveloper 10 months ago committed by Aniket
parent d1fc5a656e
commit 7ebdc7cbae
  1. 8
      apps/circuit-compiler/src/app/app.tsx
  2. 2
      apps/circuit-compiler/src/app/components/witness.tsx

@ -29,8 +29,6 @@ function App() {
if (filePath.endsWith('.circom')) { if (filePath.endsWith('.circom')) {
dispatch({ type: 'SET_FILE_PATH', payload: filePath }) dispatch({ type: 'SET_FILE_PATH', payload: filePath })
plugin.parse(filePath) plugin.parse(filePath)
} else {
dispatch({ type: 'SET_FILE_PATH', payload: '' })
} }
}) })
// @ts-ignore // @ts-ignore
@ -40,6 +38,9 @@ function App() {
plugin.parse(path, content) plugin.parse(path, content)
} }
}) })
plugin.on('filePanel', 'setWorkspace', async () => {
dispatch({ type: 'SET_FILE_PATH', payload: '' })
})
setIsPluginActivated(true) setIsPluginActivated(true)
}) })
@ -103,6 +104,9 @@ function App() {
if (appState.autoCompile) await compileCircuit(plugin, appState) if (appState.autoCompile) await compileCircuit(plugin, appState)
})() })()
} }
dispatch({ type: 'SET_SIGNAL_INPUTS', payload: [] })
dispatch({ type: 'SET_COMPILER_STATUS', payload: 'idle' })
dispatch({ type: 'SET_COMPILER_FEEDBACK', payload: null })
}, [appState.filePath]) }, [appState.filePath])
const setCurrentLocale = async () => { const setCurrentLocale = async () => {

@ -12,7 +12,7 @@ export function WitnessSection ({ plugin, signalInputs, status }: {plugin: Circo
let value = e.target.value let value = e.target.value
try { try {
value = JSON.parse(value) value = JSON.parse(JSON.stringify(value, (key, value) => typeof value === 'bigint' ? value.toString() : value))
} catch (e) { } catch (e) {
// do nothing // do nothing
} }

Loading…
Cancel
Save