custom clear function

This commit is contained in:
SpikeHD
2022-06-02 17:04:20 -07:00
parent 5aaa85939c
commit 5acd9b54d0
3 changed files with 18 additions and 1 deletions

View File

@@ -154,7 +154,17 @@ export default class Options extends React.Component<IProps, IState> {
<Tr text="options.background" />
</div>
<div className='OptionValue'>
<DirInput onChange={this.setCustomBackground} value={this.state?.bg_url_or_path} extensions={['png', 'jpg', 'jpeg']} readonly={false} />
<DirInput
onChange={this.setCustomBackground}
value={this.state?.bg_url_or_path}
extensions={['png', 'jpg', 'jpeg']}
readonly={false}
clearable={true}
customClearBehaviour={async () => {
await setConfigOption('customBackground', '')
window.location.reload()
}}
/>
</div>
</div>