Skip to content

Commit

Permalink
fix: wrong total_record in pagination /blocks, /txs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nam Dao committed Dec 12, 2022
1 parent 049c1d3 commit e6706dc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"license": "MIT",
"dependencies": {
"@astradefi/address-converter": "^0.4.1",
"@astraprotocol/astra-ui": "^1.0.20",
"@astraprotocol/astra-ui": "^1.0.24",
"@cosmjs/crypto": "^0.29.0",
"@cosmjs/encoding": "^0.29.0",
"@reduxjs/toolkit": "^1.8.5",
Expand Down
2 changes: 2 additions & 0 deletions pages/blocks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const BlockDetailPage: React.FC<NextPage> = _ => {
currentPage={pagination.page}
disabled={false}
onChange={changePage}
noted="(Only the first 50,000 result are displayed)"
/>
</div>
</div>
Expand Down Expand Up @@ -93,6 +94,7 @@ const BlockDetailPage: React.FC<NextPage> = _ => {
currentPage={pagination.page}
disabled={false}
onChange={changePage}
noted="(Only the first 50,000 result are displayed)"
/>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions pages/tx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const BlockDetailPage: React.FC<NextPage> = _ => {
currentPage={pagination.page}
disabled={false}
onChange={changePage}
noted="(Only the first 50,000 results are displayed)"
/>
</div>
</div>
Expand Down Expand Up @@ -102,6 +103,7 @@ const BlockDetailPage: React.FC<NextPage> = _ => {
currentPage={pagination.page}
disabled={false}
onChange={changePage}
noted="(Only the first 50,000 results are displayed)"
/>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions views/block/hook/useBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function useBlock() {
_setBlockItem(data?.result)
setPagination({
page: 1,
total: data?.pagination.total_page
total: Number(data?.pagination.total_record)
})
} else {
// refresh data in page 1
Expand All @@ -51,7 +51,7 @@ export default function useBlock() {
}
_setBlockItem(data?.result)
setPagination({
total: Number(data?.pagination.total_page)
total: Number(data?.pagination.total_record)
})
}
}
Expand Down
4 changes: 2 additions & 2 deletions views/transactions/hook/useTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function useTransaction() {
_setTransactionItem(convertData(data?.result))
setPagination({
page: 1,
total: Number(data?.pagination.total_page)
total: Number(data?.pagination.total_record)
})
} else {
// refresh data in page 1
Expand All @@ -74,7 +74,7 @@ export default function useTransaction() {
}
_setTransactionItem(convertData(data?.result))
setPagination({
total: Number(data?.pagination.total_page)
total: Number(data?.pagination.total_record)
})
}
}
Expand Down
9 changes: 5 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
link-module-alias "^1.2.0"
shx "^0.3.4"

"@astraprotocol/astra-ui@^1.0.20":
version "1.0.20"
resolved "https://npm.pkg.github.com/download/@astraprotocol/astra-ui/1.0.20/8da9581a7fdacd4391abd80b4a09e2cc78df6d7c#8da9581a7fdacd4391abd80b4a09e2cc78df6d7c"
integrity sha512-fC6j6D5XRGkzTwaD4AcNouJvQHGTBBtZ5lDqsyRdHZfKikyIzuOBC+zTBSGPesct0f/hWsH5LJXtQUhsX8KpUQ==
"@astraprotocol/astra-ui@^1.0.24":
version "1.0.24"
resolved "https://npm.pkg.github.com/download/@astraprotocol/astra-ui/1.0.24/4af5ab8304f8e9a4ef8a252a8cd61af4495dee33#4af5ab8304f8e9a4ef8a252a8cd61af4495dee33"
integrity sha512-ZpmpTtTEBXJHLZ4bfz5JASZHXHs6ho43YhQ99hAETlAZqYlEH86PmB/DPRaJVeMQtJQIJPa26e7lFvn5qde7TQ==
dependencies:
"@types/numeral" "^2.0.2"
"@types/react-copy-to-clipboard" "^5.0.4"
Expand All @@ -34,6 +34,7 @@
react-dom "^18.2.0"
react-number-format "^5.1.0"
react-select "^5.5.4"
react-toastify "^9.1.1"

"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.18.6":
version "7.18.6"
Expand Down

0 comments on commit e6706dc

Please sign in to comment.