|
|
@ -15,10 +15,18 @@ import { PrimeValue } from '../types' |
|
|
|
export function Container () { |
|
|
|
export function Container () { |
|
|
|
const circuitApp = useContext(CircuitAppContext) |
|
|
|
const circuitApp = useContext(CircuitAppContext) |
|
|
|
|
|
|
|
|
|
|
|
const showCompilerLicense = (message = 'License not available') => { |
|
|
|
const showCompilerLicense = async (message = 'License not available') => { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const response = await fetch('https://raw.githubusercontent.com/iden3/circom/master/COPYING') |
|
|
|
|
|
|
|
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`) |
|
|
|
|
|
|
|
const content = await response.text() |
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message: content }) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
// @ts-ignore
|
|
|
|
// @ts-ignore
|
|
|
|
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message }) |
|
|
|
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleVersionSelect = (version: string) => { |
|
|
|
const handleVersionSelect = (version: string) => { |
|
|
|
circuitApp.dispatch({ type: 'SET_COMPILER_VERSION', payload: version }) |
|
|
|
circuitApp.dispatch({ type: 'SET_COMPILER_VERSION', payload: version }) |
|
|
|