mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-01-08 12:07:45 +08:00
Add encryption alert
This commit is contained in:
parent
1c7293578c
commit
d849ea32c9
@ -16,6 +16,7 @@ import DownloadHandler from '../../../utils/download'
|
|||||||
import * as meta from '../../../utils/rsa'
|
import * as meta from '../../../utils/rsa'
|
||||||
import HelpButton from '../common/HelpButton'
|
import HelpButton from '../common/HelpButton'
|
||||||
import SmallButton from '../common/SmallButton'
|
import SmallButton from '../common/SmallButton'
|
||||||
|
import { confirm } from '@tauri-apps/api/dialog'
|
||||||
|
|
||||||
export enum GrasscutterElevation {
|
export enum GrasscutterElevation {
|
||||||
None = 'None',
|
None = 'None',
|
||||||
@ -291,6 +292,17 @@ export default class Options extends React.Component<IProps, IState> {
|
|||||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||||
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
const folderPath = path.substring(0, path.lastIndexOf('/'))
|
||||||
|
|
||||||
|
if (!(await server.encryptionEnabled(folderPath + '/config.json'))) {
|
||||||
|
if (
|
||||||
|
!(await confirm(
|
||||||
|
'Cultivation requires encryption DISABLED to connect and play locally. \n\n Are you sure you want to enable encryption?',
|
||||||
|
'Warning!'
|
||||||
|
))
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await server.toggleEncryption(folderPath + '/config.json')
|
await server.toggleEncryption(folderPath + '/config.json')
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Loading…
Reference in New Issue
Block a user