@@ -3,7 +3,7 @@ import { FormattedMessage, useIntl } from 'react-intl'
3
3
import semver from 'semver'
4
4
import { CompilerContainerProps } from './types'
5
5
import { 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'
7
7
import { canUseWorker , urlFromVersion , pathToURL } from '@remix-project/remix-solidity'
8
8
import { compilerReducer , compilerInitialState } from './reducers/compiler'
9
9
import { listenToEvents } from './actions/compiler'
@@ -197,9 +197,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
197
197
198
198
useEffect ( ( ) => {
199
199
compileTabLogic . setUseFileConfiguration ( state . useFileConfiguration )
200
- if ( state . useFileConfiguration ) {
201
- createNewConfigFile ( )
202
- }
203
200
} , [ state . useFileConfiguration ] )
204
201
205
202
useEffect ( ( ) => {
@@ -227,8 +224,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
227
224
228
225
if ( isFoundryProject && ! compilerConfig . settings . remappings ) {
229
226
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 ) )
231
227
}
228
+ await api . writeFile ( remixConfigPath , JSON . stringify ( { ...remixConfigContent , 'solidity-compiler' : compilerConfig } , null , 2 ) )
232
229
}
233
230
} else {
234
231
const config = JSON . parse ( configFileContent )
@@ -686,6 +683,11 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
686
683
setToggleExpander ( ! toggleExpander )
687
684
}
688
685
686
+ const handleConfigFileClick = async ( ) => {
687
+ await createNewConfigFile ( )
688
+ await api . open ( remixConfigPath )
689
+ }
690
+
689
691
return (
690
692
< section >
691
693
< article >
@@ -960,6 +962,11 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
960
962
< FormattedMessage id = "solidity.useConfigurationFile" />
961
963
</ label >
962
964
</ 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 >
963
970
</ div >
964
971
< div className = "px-4" >
965
972
< button
0 commit comments