Checks for localhost

Linting
This commit is contained in:
Thoronium 2023-09-16 15:10:55 -06:00
parent 4c5b79513a
commit 96bf4ef3fe
2 changed files with 20 additions and 1 deletions

View File

@ -214,7 +214,7 @@ pub fn run_jar(path: String, execute_in: String, java_path: String) {
#[cfg(not(target_os = "linux"))]
#[tauri::command]
pub fn run_jar_root(path: String, execute_in: String, java_path: String) {
pub fn run_jar_root(_path: String, _execute_in: String, _java_path: String) {
panic!("Not implemented");
}

View File

@ -16,6 +16,7 @@ import { GrasscutterElevation } from './menu/Options'
import { getGameExecutable, getGameVersion, getGrasscutterJar } from '../../utils/game'
import { patchGame, unpatchGame } from '../../utils/rsa'
import { listen } from '@tauri-apps/api/event'
import { confirm } from '@tauri-apps/api/dialog'
interface IProps {
openExtras: (playGame: () => void) => void
@ -118,6 +119,24 @@ export default class ServerLaunchSection extends React.Component<IProps, IState>
return
}
// Check for HTTPS on local
if (this.state.httpsEnabled) {
if (this.state.ip == 'localhost') {
if (
await confirm(
"Oops! HTTPS is enabled but you're connecting to localhost! \nHTTPS MUST be disabled for localhost. \n\nWould you like to disable HTTPS and continue?",
{ title: 'WARNING!!', type: 'warning' }
)
) {
this.toggleHttps()
} else {
if (!(await confirm('You have chosen to keep HTTPS enabled! \n\nYOU WILL ERROR ON LOGIN.'))) {
return
}
}
}
}
// Connect to proxy
if (config.toggle_grasscutter) {
const game_exe = await getGameExecutable()