fix category setting

This commit is contained in:
SpikeHD
2022-07-23 23:44:04 -07:00
parent ac8fd3af45
commit a25645ef77
2 changed files with 10 additions and 5 deletions

View File

@@ -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>
) )
} }

View File

@@ -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)
} }