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

hotfix for returning actual first results page

This commit is contained in:
Matthias Kretschmann 2019-04-08 12:53:44 +02:00
parent bfd48fec79
commit 26b663a09c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 6 additions and 6 deletions

View File

@ -1031,9 +1031,9 @@
"integrity": "sha512-c1LvaH+e1tzow0gZLwSWe19ap+DrZuNmZfxBdwEVEPQXarI0jTXa5qVDoiBow8kBWaqSIUgFAzQOJW8rKdlS1A=="
},
"@oceanprotocol/squid": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.5.1.tgz",
"integrity": "sha512-YJewmMIpHG5cjsOsgOynky7z+5YT7l5+niW9AqCMOoMGy76VEe1+6nmAhZ/PB9BtIpYCGWOl1Y68I32qhX9IWQ==",
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/@oceanprotocol/squid/-/squid-0.5.2.tgz",
"integrity": "sha512-HBxBP2N0M1EPX/rJ9wyP4bR+9c2z9pOH4ozOYLZl3ycSJvAQ23eyJsXL1fxYHBwMmHtcLcrVa49l3Iuxq3HOaA==",
"requires": {
"@oceanprotocol/keeper-contracts": "^0.9.0",
"bignumber.js": "^8.0.1",

View File

@ -47,7 +47,7 @@ export default class Pagination extends PureComponent<{
}> {
public render() {
const { currentPage, totalPages, prevPage, setPage } = this.props
const isFirst = currentPage === 1
const isFirst = currentPage === 0
const isLast = currentPage === totalPages
return totalPages > 1 ? (

View File

@ -28,7 +28,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
totalResults: 0,
offset: 25,
totalPages: 1,
currentPage: 1,
currentPage: 0,
isLoading: true
}
@ -59,7 +59,7 @@ export default class Search extends PureComponent<SearchProps, SearchState> {
results: search.results,
totalResults: search.totalResults,
totalPages: search.totalPages,
currentPage: search.page + 1, // first page is always 0 in response
currentPage: search.page, // first page is always 0 in response
isLoading: false
})
Logger.log(`Loaded ${this.state.results.length} assets`)