Fixed naming error

pull/4529/head
ioedeveloper 9 months ago
parent f5581128da
commit 12e3321a83
  1. 2
      apps/remix-ide/src/app/tabs/web3-provider.js
  2. 8
      apps/remix-ide/src/blockchain/blockchain.tsx
  3. 7
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx
  4. 4
      libs/remix-ui/settings/src/lib/settingsAction.ts
  5. 6
      libs/remix-ui/settings/src/lib/settingsReducer.ts

@ -65,7 +65,7 @@ export class Web3ProviderModule extends Plugin {
}, 50)
const isVM = this.blockchain.executionContext.isVM()
if (isVM) {
if (isVM && this.blockchain.config.get('settings/save-evm-state')) {
await this.blockchain.executionContext.getStateDetails().then((state) => {
this.call('fileManager', 'writeFile', `.states/${this.blockchain.executionContext.getProvider()}/state.json`, state)
})

@ -646,7 +646,7 @@ export class Blockchain extends Plugin {
}
async loadContext(context: string) {
const saveEvmState = this.config.get('settings/save-env-state')
const saveEvmState = this.config.get('settings/save-evm-state')
if (saveEvmState) {
const contextExists = await this.call('fileManager', 'exists', `.states/${context}/state.json`)
@ -655,9 +655,9 @@ export class Blockchain extends Plugin {
const stateDb = await this.call('fileManager', 'readFile', `.states/${context}/state.json`)
await this.getCurrentProvider().resetEnvironment(stateDb)
} else {
await this.getCurrentProvider().resetEnvironment()
}
} else {
await this.getCurrentProvider().resetEnvironment()
}
// TODO: most params here can be refactored away in txRunner
@ -904,7 +904,7 @@ export class Blockchain extends Plugin {
let execResult
let returnValue = null
if (isVM) {
if (!tx.useCall) {
if (!tx.useCall && this.config.get('settings/save-evm-state')) {
await this.executionContext.getStateDetails().then((state) => {
this.call('fileManager', 'writeFile', `.states/${this.executionContext.getProvider()}/state.json`, state)
})

@ -205,7 +205,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
}
const onchangeSaveEnvState= (event) => {
console.log('saveEnvState', event.target.checked)
saveEnvState(props.config, event.target.checked, dispatch)
}
@ -226,7 +225,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const isAutoCompleteChecked = props.config.get('settings/auto-completion') || false
const isShowGasInEditorChecked = props.config.get('settings/show-gas') || false
const displayErrorsChecked = props.config.get('settings/display-errors') || false
const isSaveEnvStateChecked = props.config.get('settings/save-env-state') || false
const isSaveEvmStateChecked = props.config.get('settings/save-evm-state') || false
return (
<div className="$border-top">
<div className="d-flex justify-content-end pr-4">
@ -344,9 +343,9 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
</label>
</div>
<div className="custom-control custom-checkbox mb-1">
<input onChange={onchangeSaveEnvState} id="settingsEnableSaveEnvState" type="checkbox" className="custom-control-input" checked={isSaveEnvStateChecked} />
<input onChange={onchangeSaveEnvState} id="settingsEnableSaveEnvState" type="checkbox" className="custom-control-input" checked={isSaveEvmStateChecked} />
<label
className={`form-check-label custom-control-label align-middle ${getTextClass('settings/save-env-state')}`}
className={`form-check-label custom-control-label align-middle ${getTextClass('settings/save-evm-state')}`}
data-id="settingsEnableSaveEnvStateLabel"
htmlFor="settingsEnableSaveEnvState"
>

@ -92,6 +92,6 @@ export const saveIpfsSettingsToast = (config, dispatch, ipfsURL, ipfsProtocol, i
}
export const saveEnvState = (config, checked, dispatch) => {
config.set('settings/save-env-state', checked)
dispatch({ type: 'save-env-state', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
config.set('settings/save-evm-state', checked)
dispatch({ type: 'save-evm-state', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
}

@ -58,7 +58,7 @@ export const initialState = {
textClass: textSecondary
},
{
name: 'save-env-state',
name: 'save-evm-state',
isChecked: false,
textClass: textSecondary
},
@ -179,9 +179,9 @@ export const settingReducer = (state, action) => {
...state
}
case 'save-env-state':
case 'save-evm-state':
state.elementState.map(element => {
if (element.name === 'save-env-state') {
if (element.name === 'save-evm-state') {
element.isChecked = action.payload.isChecked
element.textClass = action.payload.textClass
}

Loading…
Cancel
Save