Merge pull request #856 from mempool/simon/mempool-blocks-amount-display-fix

Display correct amount of mempool blocks on mobile
This commit is contained in:
wiz 2021-10-07 08:03:42 +09:00 committed by GitHub
commit e1c943d0a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,7 +184,8 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
}
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) {
const block = blocks.pop();
const lastBlock = blocks[blocks.length - 1];