1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

switch to respective page if query string is present

This commit is contained in:
Matthias Kretschmann 2019-04-09 13:12:58 +02:00
parent 2a2955d593
commit efbfd91c65
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -34,8 +34,16 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
private readonly searchTerm = queryString.parse(this.props.location.search)
.text
private readonly searchPage = queryString.parse(this.props.location.search)
.page
public async componentDidMount() {
// switch to respective page if query string is present
if (this.searchPage) {
const currentPage = Number(this.searchPage)
await this.setState({ currentPage })
}
public componentDidMount() {
this.searchAssets()
}