diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 8dd50b2..6225067 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -62,6 +62,7 @@ export default class Options extends React.Component { // 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') this.setState({ game_install_path: config.game_install_path || '', @@ -73,7 +74,7 @@ export default class Options extends React.Component { bg_url_or_path: config.customBackground || '', themes: (await getThemeList()).map(t => t.name), theme: config.theme || 'default', - encryption: await server.encryptionEnabled(folderPath + '/config.json') || false + encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled') }) this.forceUpdate() @@ -162,7 +163,7 @@ export default class Options extends React.Component { await server.toggleEncryption(folderPath + '/config.json') this.setState({ - encryption: !this.state.encryption + encryption: await translate(await server.encryptionEnabled(folderPath + '/config.json') ? 'options.enabled' : 'options.disabled') }) } @@ -192,9 +193,7 @@ export default class Options extends React.Component {
{ - this.state.encryption ? - : - + this.state.encryption }