Skip to content

Commit 42b30c1

Browse files
authored
Merge pull request #4283 from ethereum/circom-license
Load compiler license for circom
2 parents 7962143 + 2e06f74 commit 42b30c1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ import { PrimeValue } from '../types'
1515
export function Container () {
1616
const circuitApp = useContext(CircuitAppContext)
1717

18-
const showCompilerLicense = (message = 'License not available') => {
19-
// @ts-ignore
20-
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message })
18+
const showCompilerLicense = async (message = 'License not available') => {
19+
try {
20+
const response = await fetch('https://raw.githubusercontent.com/iden3/circom/master/COPYING')
21+
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`)
22+
const content = await response.text()
23+
// @ts-ignore
24+
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message: content })
25+
} catch (e) {
26+
// @ts-ignore
27+
circuitApp.plugin.call('notification', 'modal', { id: 'modal_circuit_compiler_license', title: 'Compiler License', message })
28+
}
2129
}
2230

2331
const handleVersionSelect = (version: string) => {

0 commit comments

Comments
 (0)