mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 08:04:52 +01:00
Syntax
This commit is contained in:
@@ -143,15 +143,18 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setGrasscutterJar(value: string) {
|
async setGrasscutterJar(value: string) {
|
||||||
setConfigOption('grasscutter_path', value)
|
setConfigOption('grasscutter_path', value)
|
||||||
|
|
||||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
grasscutter_path: value,
|
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
|
// Update encryption button when setting new jar
|
||||||
this.setState({
|
this.setState({
|
||||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
||||||
|
|||||||
Reference in New Issue
Block a user