reload launcher on bg set

This commit is contained in:
SpikeHD
2022-06-01 18:59:33 -07:00
parent aedd7ecf3c
commit c1973a2d2e

View File

@@ -38,6 +38,7 @@ export default class Options extends React.Component<IProps, IState> {
}
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
this.setCustomBackground = this.setCustomBackground.bind(this)
}
async componentDidMount() {
@@ -86,13 +87,15 @@ export default class Options extends React.Component<IProps, IState> {
const filename = value.replace(/\\/g, '/').split('/').pop()
const localBgPath = (await dataDir() as string).replace(/\\/g, '/')
setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
await setConfigOption('customBackground', `${localBgPath}/cultivation/bg/${filename}`)
// Copy the file over to the local directory
invoke('copy_file', {
await invoke('copy_file', {
path: value.replace(/\\/g, '/'),
newPath: `${localBgPath}cultivation/bg/`
})
window.location.reload()
}
render() {