mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 07:34:36 +01:00
Fix trying to open nonexistant config
If you try to open settings, or change the "Toggle Encryption" toggle, while GC's server config does not exist it no longer throws an error message.
This commit is contained in:
@@ -99,10 +99,13 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
const languages = await getLanguages()
|
const languages = await getLanguages()
|
||||||
const platform: string = await invoke('get_platform')
|
const platform: string = await invoke('get_platform')
|
||||||
|
|
||||||
// Remove jar from path
|
let encEnabled
|
||||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
if (config.grasscutter_path) {
|
||||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
// Remove jar from path
|
||||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||||
|
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||||
|
encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||||
|
}
|
||||||
|
|
||||||
console.log(platform)
|
console.log(platform)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user