|
|
@ -9,6 +9,7 @@ import { Toaster } from '@remix-ui/toaster'// eslint-disable-line |
|
|
|
import { RemixUiThemeModule, ThemeModule} from '@remix-ui/theme-module' |
|
|
|
import { RemixUiThemeModule, ThemeModule} from '@remix-ui/theme-module' |
|
|
|
import { GithubSettings } from './github-settings' |
|
|
|
import { GithubSettings } from './github-settings' |
|
|
|
import { EtherscanSettings } from './etherscan-settings' |
|
|
|
import { EtherscanSettings } from './etherscan-settings' |
|
|
|
|
|
|
|
import { CustomTooltip } from '@remix-ui/helper' |
|
|
|
|
|
|
|
|
|
|
|
/* eslint-disable-next-line */ |
|
|
|
/* eslint-disable-next-line */ |
|
|
|
export interface RemixUiSettingsProps { |
|
|
|
export interface RemixUiSettingsProps { |
|
|
@ -154,25 +155,32 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { |
|
|
|
const displayErrorsChecked = props.config.get('settings/display-errors') || false |
|
|
|
const displayErrorsChecked = props.config.get('settings/display-errors') || false |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="$border-top"> |
|
|
|
<div className="$border-top"> |
|
|
|
<div title="Reset to Default settings." className='d-flex justify-content-end pr-4'> |
|
|
|
<CustomTooltip |
|
|
|
<button className="btn btn-sm btn-secondary ml-2" onClick={() => { |
|
|
|
tooltipText="Reset to Default settings" |
|
|
|
try { |
|
|
|
tooltipId="resetDefaultTooltip" |
|
|
|
if ((window as any).remixFileSystem.name === 'indexedDB') { |
|
|
|
tooltipClasses="text-nowrap" |
|
|
|
props.config.clear() |
|
|
|
placement="top-start" |
|
|
|
try { |
|
|
|
> |
|
|
|
localStorage.clear() // remove the whole storage
|
|
|
|
<div className='d-flex justify-content-end pr-4'> |
|
|
|
} catch (e) { |
|
|
|
<button className="btn btn-sm btn-secondary ml-2" onClick={() => { |
|
|
|
console.log(e) |
|
|
|
try { |
|
|
|
|
|
|
|
if ((window as any).remixFileSystem.name === 'indexedDB') { |
|
|
|
|
|
|
|
props.config.clear() |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
localStorage.clear() // remove the whole storage
|
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.log(e) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
props.config.clear() // remove only the remix settings
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
refresh(resetState + 1) |
|
|
|
props.config.clear() // remove only the remix settings
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.log(e) |
|
|
|
} |
|
|
|
} |
|
|
|
refresh(resetState + 1) |
|
|
|
}}>Reset to Default settings</button> |
|
|
|
} catch (e) { |
|
|
|
</div> |
|
|
|
console.log(e) |
|
|
|
</CustomTooltip> |
|
|
|
} |
|
|
|
|
|
|
|
}}>Reset to Default settings</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="card-body pt-3 pb-2"> |
|
|
|
<div className="card-body pt-3 pb-2"> |
|
|
|
<h6 className="card-title">General settings</h6> |
|
|
|
<h6 className="card-title">General settings</h6> |
|
|
|
<div className="mt-2 custom-control custom-checkbox mb-1"> |
|
|
|
<div className="mt-2 custom-control custom-checkbox mb-1"> |
|
|
|