diff --git a/apps/vyper/src/app/app.tsx b/apps/vyper/src/app/app.tsx index f6f0ef2279..3234ecd5b7 100644 --- a/apps/vyper/src/app/app.tsx +++ b/apps/vyper/src/app/app.tsx @@ -161,7 +161,7 @@ const App = () => { in the .vy file.
- setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} /> + setOutput({...output, [name]: update})} resetCompilerState={resetCompilerResultState} output={output} />
diff --git a/apps/vyper/src/app/components/CompilerButton.tsx b/apps/vyper/src/app/components/CompilerButton.tsx index 54597171e9..2253d0d2bd 100644 --- a/apps/vyper/src/app/components/CompilerButton.tsx +++ b/apps/vyper/src/app/components/CompilerButton.tsx @@ -1,16 +1,18 @@ -import React, { Fragment, useState } from 'react' +import React, { Fragment, useEffect, useState } from 'react' import {isVyper, compile, toStandardOutput, isCompilationError, remixClient, normalizeContractPath, compileContract} from '../utils' import Button from 'react-bootstrap/Button' interface Props { compilerUrl: string contract?: string + output?: any setOutput: (name: string, output: any) => void resetCompilerState: () => void } -function CompilerButton({contract, setOutput, compilerUrl, resetCompilerState}: Props) { +function CompilerButton({contract, setOutput, compilerUrl, resetCompilerState, output}: Props) { const [loadingSpinner, setLoadingSpinnerState] = useState(false) + if (!contract || !contract) { return } @@ -19,17 +21,29 @@ function CompilerButton({contract, setOutput, compilerUrl, resetCompilerState}: return } + // useEffect(() => { + // const checkCompileOutput = () => { + // if (output && Object.keys(output).length > 0) { + // setLoadingSpinnerState(false) + // } + // } + // checkCompileOutput() + // }, []) + /** Compile a Contract */ return (