diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 1f4ddd785d..ade8e37271 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -25,7 +25,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { const [themeName, ] = useState('') const [privateBeeAddress, setPrivateBeeAddress] = useState('') const [postageStampId, setPostageStampId] = useState('') - const [resetState, refresh] = useState(0) + const [reset, setReset] = useState(false) const initValue = () => { const metadataConfig = props.config.get('settings/generate-contract-metadata') @@ -34,7 +34,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { const javascriptVM = props.config.get('settings/always-use-vm') if (javascriptVM === null || javascriptVM === undefined) ethereumVM(props.config, true, dispatch) } - useEffect(() => initValue(), [resetState, props.config]) + useEffect(() => initValue(), [reset]) useEffect(() => initValue(), []) useEffect(() => { @@ -115,7 +115,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { } else { props.config.clear() // remove only the remix settings } - refresh(resetState + 1) + setReset(!reset) } catch (e) { console.log(e) }