Skip to content

Commit

Permalink
Merge pull request #4283 from ethereum/circom-license
Browse files Browse the repository at this point in the history
Load compiler license for circom
  • Loading branch information
yann300 authored Nov 30, 2023
2 parents 7962143 + 2e06f74 commit 42b30c1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/circuit-compiler/src/app/components/container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ import { PrimeValue } from '../types'
export function Container () {
const circuitApp = useContext(CircuitAppContext)

const showCompilerLicense = (message = 'License not available') => {
// @ts-ignore
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message })
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
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message })
}
}

const handleVersionSelect = (version: string) => {
Expand Down

0 comments on commit 42b30c1

Please sign in to comment.