Display correct amount of mempool blocks on mobile

fixes #854
This commit is contained in:
softsimon 2021-10-05 15:40:28 +04:00
parent 2bac7f9987
commit b48389ae7d
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -184,7 +184,8 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
} }
reduceMempoolBlocksToFitScreen(blocks: MempoolBlock[]): MempoolBlock[] { reduceMempoolBlocksToFitScreen(blocks: MempoolBlock[]): MempoolBlock[] {
const blocksAmount = Math.min(this.stateService.env.MEMPOOL_BLOCKS_AMOUNT, Math.floor(window.innerWidth / 2 / (this.blockWidth + this.blockPadding))); const innerWidth = this.stateService.env.BASE_MODULE !== 'liquid' && window.innerWidth <= 767.98 ? window.innerWidth : window.innerWidth / 2;
const blocksAmount = Math.min(this.stateService.env.MEMPOOL_BLOCKS_AMOUNT, Math.floor(innerWidth / (this.blockWidth + this.blockPadding)));
while (blocks.length > blocksAmount) { while (blocks.length > blocksAmount) {
const block = blocks.pop(); const block = blocks.pop();
const lastBlock = blocks[blocks.length - 1]; const lastBlock = blocks[blocks.length - 1];