@@ -3,7 +3,7 @@ import { FormattedMessage, useIntl } from 'react-intl'
33import semver from 'semver'
44import { CompilerContainerProps } from './types'
55import { ConfigurationSettings } from '@remix-project/remix-lib'
6- import { checkSpecialChars , CustomTooltip , extractNameFromKey } from '@remix-ui/helper'
6+ import { checkSpecialChars , CustomTooltip , extractNameFromKey , RenderIf } from '@remix-ui/helper'
77import { canUseWorker , urlFromVersion , pathToURL } from '@remix-project/remix-solidity'
88import { compilerReducer , compilerInitialState } from './reducers/compiler'
99import { listenToEvents } from './actions/compiler'
@@ -197,9 +197,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
197197
198198 useEffect ( ( ) => {
199199 compileTabLogic . setUseFileConfiguration ( state . useFileConfiguration )
200- if ( state . useFileConfiguration ) {
201- createNewConfigFile ( )
202- }
203200 } , [ state . useFileConfiguration ] )
204201
205202 useEffect ( ( ) => {
@@ -227,8 +224,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
227224
228225 if ( isFoundryProject && ! compilerConfig . settings . remappings ) {
229226 compilerConfig . settings . remappings = [ 'ds-test/=lib/forge-std/lib/ds-test/src/' , 'forge-std/=lib /forge-std/src/' ]
230- await api . writeFile ( remixConfigPath , JSON . stringify ( { ...remixConfigContent , 'solidity-compiler' : compilerConfig } , null , 2 ) )
231227 }
228+ await api . writeFile ( remixConfigPath , JSON . stringify ( { ...remixConfigContent , 'solidity-compiler' : compilerConfig } , null , 2 ) )
232229 }
233230 } else {
234231 const config = JSON . parse ( configFileContent )
@@ -686,6 +683,11 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
686683 setToggleExpander ( ! toggleExpander )
687684 }
688685
686+ const handleConfigFileClick = async ( ) => {
687+ await createNewConfigFile ( )
688+ await api . open ( remixConfigPath )
689+ }
690+
689691 return (
690692 < section >
691693 < article >
@@ -960,6 +962,11 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
960962 < FormattedMessage id = "solidity.useConfigurationFile" />
961963 </ label >
962964 </ div >
965+ < RenderIf condition = { state . useFileConfiguration } >
966+ < a data-id = "view-noir-compilation-result" className = "cursor-pointer text-decoration-none ms-4" href = '#' onClick = { handleConfigFileClick } >
967+ < i className = "text-secondary mt-1 pe-1 far fa-edit" > </ i > Update config remix.config.json
968+ </ a >
969+ </ RenderIf >
963970 </ div >
964971 < div className = "px-4" >
965972 < button
0 commit comments