mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
fix category setting
This commit is contained in:
@@ -52,9 +52,12 @@ export class Mods extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setCategory(value: string) {
|
async setCategory(value: string) {
|
||||||
this.setState({
|
this.setState(
|
||||||
category: value,
|
{
|
||||||
})
|
category: value,
|
||||||
|
},
|
||||||
|
this.forceUpdate
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -62,9 +65,9 @@ export class Mods extends React.Component<IProps, IState> {
|
|||||||
<div className="Mods">
|
<div className="Mods">
|
||||||
<TopBar />
|
<TopBar />
|
||||||
|
|
||||||
<ModHeader onChange={this.setCategory} headers={headers} defaultHeader={'hot'} />
|
<ModHeader onChange={this.setCategory} headers={headers} defaultHeader={'ripe'} />
|
||||||
|
|
||||||
<ModList mode={this.state.category} addDownload={this.addDownload} />
|
<ModList key={this.state.category} mode={this.state.category} addDownload={this.addDownload} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ export class ModList extends React.Component<IProps, IState> {
|
|||||||
constructor(props: IProps) {
|
constructor(props: IProps) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
|
console.log('Getting')
|
||||||
|
|
||||||
this.downloadMod = this.downloadMod.bind(this)
|
this.downloadMod = this.downloadMod.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user