Change encryption to checkbox

This commit is contained in:
Thoronium
2023-04-06 23:29:31 -06:00
parent 891dbb41aa
commit db11cf7907

View File

@@ -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">