Merge pull request #1912 from mempool/nymkappa/bugfix/dont-preload-genesis
Don't preload /block APIs for genesis block
This commit is contained in:
commit
9991d43b3b
@ -155,6 +155,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
tap((block: BlockExtended) => {
|
tap((block: BlockExtended) => {
|
||||||
|
if (block.height > 0) {
|
||||||
// Preload previous block summary (execute the http query so the response will be cached)
|
// Preload previous block summary (execute the http query so the response will be cached)
|
||||||
this.unsubscribeNextBlockSubscriptions();
|
this.unsubscribeNextBlockSubscriptions();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -162,6 +163,7 @@ export class BlockComponent implements OnInit, OnDestroy {
|
|||||||
this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(block.previousblockhash).subscribe();
|
this.nextBlockTxListSubscription = this.electrsApiService.getBlockTransactions$(block.previousblockhash).subscribe();
|
||||||
this.nextBlockSummarySubscription = this.apiService.getStrippedBlockTransactions$(block.previousblockhash).subscribe();
|
this.nextBlockSummarySubscription = this.apiService.getStrippedBlockTransactions$(block.previousblockhash).subscribe();
|
||||||
}, 100);
|
}, 100);
|
||||||
|
}
|
||||||
|
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.blockHeight = block.height;
|
this.blockHeight = block.height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user