mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-01-07 03:26:56 +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 HelpButton from '../common/HelpButton'
|
||||
import SmallButton from '../common/SmallButton'
|
||||
import { confirm } from '@tauri-apps/api/dialog'
|
||||
|
||||
export enum GrasscutterElevation {
|
||||
None = 'None',
|
||||
@ -291,6 +292,17 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
const path = config.grasscutter_path.replace(/\\/g, '/')
|
||||
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')
|
||||
|
||||
this.setState({
|
||||
|
Loading…
Reference in New Issue
Block a user