This commit is contained in:
Thoronium
2023-02-26 15:26:10 -07:00
committed by GitHub
parent b352b16dc9
commit 182943fd69

View File

@@ -143,15 +143,18 @@ export default class Options extends React.Component<IProps, IState> {
})
}
setGrasscutterJar(value: string) {
async setGrasscutterJar(value: string) {
setConfigOption('grasscutter_path', value)
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
this.setState({
grasscutter_path: value,
})
const config = await getConfig()
const path = config.grasscutter_path.replace(/\\/g, '/')
const folderPath = path.substring(0, path.lastIndexOf('/'))
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
// Update encryption button when setting new jar
this.setState({
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),