mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-06 02:06:29 +01:00
Only detect game path on windows
This commit is contained in:
@@ -45,6 +45,7 @@ interface IState {
|
|||||||
notification: React.ReactElement | null
|
notification: React.ReactElement | null
|
||||||
isGamePathSet: boolean
|
isGamePathSet: boolean
|
||||||
game_install_path: string
|
game_install_path: string
|
||||||
|
platform: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Main extends React.Component<IProps, IState> {
|
export class Main extends React.Component<IProps, IState> {
|
||||||
@@ -64,6 +65,7 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
notification: null,
|
notification: null,
|
||||||
isGamePathSet: true,
|
isGamePathSet: true,
|
||||||
game_install_path: '',
|
game_install_path: '',
|
||||||
|
platform: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
listen('lang_error', (payload) => {
|
listen('lang_error', (payload) => {
|
||||||
@@ -156,6 +158,10 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
migotoSet: !!(await getConfigOption('migoto_path')),
|
migotoSet: !!(await getConfigOption('migoto_path')),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
platform: await invoke('get_platform'),
|
||||||
|
})
|
||||||
|
|
||||||
if (!cert_generated) {
|
if (!cert_generated) {
|
||||||
// Generate the certificate
|
// Generate the certificate
|
||||||
await invoke('generate_ca_files', {
|
await invoke('generate_ca_files', {
|
||||||
@@ -222,7 +228,7 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
})) as boolean
|
})) as boolean
|
||||||
|
|
||||||
// Set no game path so the user understands it doesn't exist there
|
// Set no game path so the user understands it doesn't exist there
|
||||||
if (!game_exists) {
|
if (!game_exists && this.state.platform === 'windows') {
|
||||||
setConfigOption('game_install_path', '')
|
setConfigOption('game_install_path', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user