Fix pagination on /mining/blocks

This commit is contained in:
nymkappa committed 2022-03-16 21:00:40 +01:00
1 parent 622e0058f3
commit 671c25870c
3 files changed
+7 -7

No files matched your search

+2 -3
View File
@@ -350,15 +350,14 @@ class Blocks {
return prepareBlock(blockExtended);
}
public async $getBlocksExtras(fromHeight: number, limit: number = 15,
poolId: number | undefined= undefined): Promise<BlockExtended[]> {
public async $getBlocksExtras(fromHeight?: number, limit: number = 15): Promise<BlockExtended[]> {
// Note - This API is breaking if indexing is not available. For now it is okay because we only
// use it for the mining pages, and mining pages should not be available if indexing is turned off.
// I'll need to fix it before we refactor the block(s) related pages
try {
loadingIndicators.setProgress('blocks', 0);
let currentHeight = fromHeight ? fromHeight : this.getCurrentBlockHeight();
let currentHeight = fromHeight !== undefined ? fromHeight : this.getCurrentBlockHeight();
const returnBlocks: BlockExtended[] = [];
if (currentHeight < 0) {