mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
fix options checkbox
This commit is contained in:
@@ -30,7 +30,7 @@ export default class Checkbox extends React.Component<IProps, IState> {
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
return { checked: props.checked }
|
||||
}
|
||||
|
||||
handleChange = () => {
|
||||
|
||||
@@ -28,8 +28,6 @@ export default class DirInput extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
this.handleIconClick = this.handleIconClick.bind(this)
|
||||
|
||||
console.log(this.props)
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props: IProps, state: IState) {
|
||||
|
||||
@@ -35,6 +35,8 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
current_language: 'en',
|
||||
bg_url_or_path: ''
|
||||
}
|
||||
|
||||
this.toggleGrasscutterWithGame = this.toggleGrasscutterWithGame.bind(this)
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
@@ -71,7 +73,12 @@ export default class Options extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async toggleGrasscutterWithGame() {
|
||||
setConfigOption('grasscutter_with_game', !(await getConfigOption('grasscutter_with_game')))
|
||||
const changedVal = !(await getConfigOption('grasscutter_with_game'))
|
||||
setConfigOption('grasscutter_with_game', changedVal)
|
||||
|
||||
this.setState({
|
||||
grasscutter_with_game: changedVal
|
||||
})
|
||||
}
|
||||
|
||||
setCustomBackground() {
|
||||
|
||||
Reference in New Issue
Block a user