mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-04 09:25:16 +01:00
@@ -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) => {
|
||||||
@@ -152,10 +154,18 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
game_install_path: game_path,
|
game_install_path: game_path,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (this.state.game_install_path === '') {
|
||||||
|
this.setState({ isGamePathSet: false })
|
||||||
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
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', {
|
||||||
@@ -169,6 +179,9 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
const updatedConfig = await getConfigOption('patch_rsa')
|
const updatedConfig = await getConfigOption('patch_rsa')
|
||||||
await setConfigOption('patch_rsa', updatedConfig)
|
await setConfigOption('patch_rsa', updatedConfig)
|
||||||
|
|
||||||
|
// Update launch args to allow launching when updating from old versions
|
||||||
|
await setConfigOption('launch_args', await getConfigOption('launch_args'))
|
||||||
|
|
||||||
// Get latest version and compare to this version
|
// Get latest version and compare to this version
|
||||||
const latestVersion: {
|
const latestVersion: {
|
||||||
tag_name: string
|
tag_name: string
|
||||||
@@ -222,7 +235,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', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,7 +336,10 @@ export class Main extends React.Component<IProps, IState> {
|
|||||||
this.state.optionsOpen ? (
|
this.state.optionsOpen ? (
|
||||||
<Options
|
<Options
|
||||||
downloadManager={this.props.downloadHandler}
|
downloadManager={this.props.downloadHandler}
|
||||||
closeFn={() => this.setState({ optionsOpen: !this.state.optionsOpen })}
|
closeFn={async () => {
|
||||||
|
this.setState({ optionsOpen: !this.state.optionsOpen })
|
||||||
|
this.setState({ migotoSet: !!(await getConfigOption('migoto_path')) })
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
) : null
|
) : null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user