mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
Change encryption to checkbox
This commit is contained in:
@@ -111,7 +111,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
bg_url_or_path: config.customBackground || '',
|
bg_url_or_path: config.customBackground || '',
|
||||||
themes: (await getThemeList()).map((t) => t.name),
|
themes: (await getThemeList()).map((t) => t.name),
|
||||||
theme: config.theme || 'default',
|
theme: config.theme || 'default',
|
||||||
encryption: await translate(encEnabled ? 'options.enabled' : 'options.disabled'),
|
encryption: encEnabled || false,
|
||||||
patch_rsa: config.patch_rsa || false,
|
patch_rsa: config.patch_rsa || false,
|
||||||
use_internal_proxy: config.use_internal_proxy || false,
|
use_internal_proxy: config.use_internal_proxy || false,
|
||||||
wipe_login: config.wipe_login || false,
|
wipe_login: config.wipe_login || false,
|
||||||
@@ -162,7 +162,7 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
// 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: encEnabled,
|
||||||
})
|
})
|
||||||
|
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
@@ -264,8 +264,8 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
await server.toggleEncryption(folderPath + '/config.json')
|
await server.toggleEncryption(folderPath + '/config.json')
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
encryption: await translate(
|
encryption: (
|
||||||
(await server.encryptionEnabled(folderPath + '/config.json')) ? 'options.enabled' : 'options.disabled'
|
(await server.encryptionEnabled(folderPath + '/config.json'))
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -399,9 +399,11 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
<HelpButton contents="help.encryption" />
|
<HelpButton contents="help.encryption" />
|
||||||
</div>
|
</div>
|
||||||
<div className="OptionValue" id="menuOptionsButtonToggleEnc">
|
<div className="OptionValue" id="menuOptionsButtonToggleEnc">
|
||||||
<BigButton onClick={this.toggleEncryption} id="toggleEnc">
|
<Checkbox
|
||||||
{this.state.encryption}
|
onChange={() => this.toggleEncryption()}
|
||||||
</BigButton>
|
checked={this.state.encryption}
|
||||||
|
id="toggleEnc"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="OptionSection" id="menuOptionsContainerInstallCert">
|
<div className="OptionSection" id="menuOptionsContainerInstallCert">
|
||||||
|
|||||||
Reference in New Issue
Block a user