mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +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 platform: string = await invoke('get_platform')
|
||||
|
||||
// Remove jar from path
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
const encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||
let encEnabled
|
||||
if (config.grasscutter_path) {
|
||||
// Remove jar from path
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||
encEnabled = await server.encryptionEnabled(folderPath + '/config.json')
|
||||
}
|
||||
|
||||
console.log(platform)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user