|
|
@ -23,6 +23,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
const [state, setState] = useState({ |
|
|
|
const [state, setState] = useState({ |
|
|
|
hideWarnings: false, |
|
|
|
hideWarnings: false, |
|
|
|
autoCompile: false, |
|
|
|
autoCompile: false, |
|
|
|
|
|
|
|
matomoAutocompileOnce: true, |
|
|
|
optimize: false, |
|
|
|
optimize: false, |
|
|
|
compileTimeout: null, |
|
|
|
compileTimeout: null, |
|
|
|
timeout: 300, |
|
|
|
timeout: 300, |
|
|
@ -69,7 +70,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
const optimize = params.optimize |
|
|
|
const optimize = params.optimize |
|
|
|
const runs = params.runs as string |
|
|
|
const runs = params.runs as string |
|
|
|
const evmVersion = params.evmVersion |
|
|
|
const evmVersion = params.evmVersion |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
...prevState, |
|
|
|
...prevState, |
|
|
|
hideWarnings: api.getAppParameter('hideWarnings') as boolean || false, |
|
|
|
hideWarnings: api.getAppParameter('hideWarnings') as boolean || false, |
|
|
@ -135,6 +135,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [configurationSettings]) |
|
|
|
}, [configurationSettings]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _retrieveVersion = (version?) => { |
|
|
|
|
|
|
|
if (!version) version = state.selectedVersion |
|
|
|
|
|
|
|
if (version === 'builtin') version = state.defaultVersion |
|
|
|
|
|
|
|
return semver.coerce(version) ? semver.coerce(version).version : '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// fetching both normal and wasm builds and creating a [version, baseUrl] map
|
|
|
|
// fetching both normal and wasm builds and creating a [version, baseUrl] map
|
|
|
|
const fetchAllVersion = async (callback) => { |
|
|
|
const fetchAllVersion = async (callback) => { |
|
|
|
let selectedVersion, allVersionsWasm, isURL |
|
|
|
let selectedVersion, allVersionsWasm, isURL |
|
|
@ -281,7 +287,14 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
compileIcon.current.setAttribute('title', 'idle') |
|
|
|
compileIcon.current.setAttribute('title', 'idle') |
|
|
|
compileIcon.current.classList.remove('remixui_spinningIcon') |
|
|
|
compileIcon.current.classList.remove('remixui_spinningIcon') |
|
|
|
compileIcon.current.classList.remove('remixui_bouncingIcon') |
|
|
|
compileIcon.current.classList.remove('remixui_bouncingIcon') |
|
|
|
|
|
|
|
if (!state.autoCompile || (state.autoCompile && state.matomoAutocompileOnce)) { |
|
|
|
_paq.push(['trackEvent', 'compiler', 'compiled_with_version', _retrieveVersion()]) |
|
|
|
_paq.push(['trackEvent', 'compiler', 'compiled_with_version', _retrieveVersion()]) |
|
|
|
|
|
|
|
if (state.autoCompile && state.matomoAutocompileOnce) { |
|
|
|
|
|
|
|
setState(prevState => { |
|
|
|
|
|
|
|
return { ...prevState, matomoAutocompileOnce: false } |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const scheduleCompilation = () => { |
|
|
|
const scheduleCompilation = () => { |
|
|
@ -305,12 +318,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
compileTabLogic.runCompiler(hhCompilation) |
|
|
|
compileTabLogic.runCompiler(hhCompilation) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const _retrieveVersion = (version?) => { |
|
|
|
|
|
|
|
if (!version) version = state.selectedVersion |
|
|
|
|
|
|
|
if (version === 'builtin') version = state.defaultVersion |
|
|
|
|
|
|
|
return semver.coerce(version) ? semver.coerce(version).version : '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _updateVersionSelector = (version, customUrl = '') => { |
|
|
|
const _updateVersionSelector = (version, customUrl = '') => { |
|
|
|
// update selectedversion of previous one got filtered out
|
|
|
|
// update selectedversion of previous one got filtered out
|
|
|
|
let selectedVersion = version |
|
|
|
let selectedVersion = version |
|
|
@ -384,7 +391,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
|
|
|
|
|
|
|
|
const handleLoadVersion = (value) => { |
|
|
|
const handleLoadVersion = (value) => { |
|
|
|
setState(prevState => { |
|
|
|
setState(prevState => { |
|
|
|
return { ...prevState, selectedVersion: value } |
|
|
|
return { ...prevState, selectedVersion: value, matomoAutocompileOnce: true } |
|
|
|
}) |
|
|
|
}) |
|
|
|
updateCurrentVersion(value) |
|
|
|
updateCurrentVersion(value) |
|
|
|
_updateVersionSelector(value) |
|
|
|
_updateVersionSelector(value) |
|
|
@ -405,7 +412,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { |
|
|
|
api.setAppParameter('autoCompile', checked) |
|
|
|
api.setAppParameter('autoCompile', checked) |
|
|
|
checked && compile() |
|
|
|
checked && compile() |
|
|
|
setState(prevState => { |
|
|
|
setState(prevState => { |
|
|
|
return { ...prevState, autoCompile: checked } |
|
|
|
return { ...prevState, autoCompile: checked, matomoAutocompileOnce: state.matomoAutocompileOnce || checked } |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|