From d849ea32c905f0b3dc2e8c21d928880c7d8da12b Mon Sep 17 00:00:00 2001 From: Thoronium <107363768+NotThorny@users.noreply.github.com> Date: Sat, 16 Sep 2023 17:45:35 -0600 Subject: [PATCH] Add encryption alert --- src/ui/components/menu/Options.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ui/components/menu/Options.tsx b/src/ui/components/menu/Options.tsx index 42cf46e..1263b7d 100644 --- a/src/ui/components/menu/Options.tsx +++ b/src/ui/components/menu/Options.tsx @@ -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 { 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({