From 6662bc464635a1e512dc3e85672b2489cfb9a705 Mon Sep 17 00:00:00 2001 From: softsimon Date: Thu, 4 Jun 2020 15:08:24 +0700 Subject: [PATCH] Display at least one standalone mempool block. Upgrade some packages to ng 9. --- frontend/package.json | 4 ++-- frontend/src/app/assets/assets.component.ts | 5 +---- .../components/mempool-blocks/mempool-blocks.component.ts | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index acbaaf54b..924f6176d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -39,12 +39,12 @@ "@angular/platform-browser": "~9.1.0", "@angular/platform-browser-dynamic": "~9.1.0", "@angular/router": "~9.1.0", - "@ng-bootstrap/ng-bootstrap": "^5.3.0", + "@ng-bootstrap/ng-bootstrap": "^6.1.0", "@types/qrcode": "^1.3.4", "bootstrap": "4.5.0", "chartist": "^0.11.4", "clipboard": "^2.0.4", - "ngx-infinite-scroll": "^8.0.1", + "ngx-infinite-scroll": "^9.0.0", "qrcode": "^1.4.4", "rxjs": "~6.5.3", "tlite": "^0.1.9", diff --git a/frontend/src/app/assets/assets.component.ts b/frontend/src/app/assets/assets.component.ts index cbe6781d7..d63d13377 100644 --- a/frontend/src/app/assets/assets.component.ts +++ b/frontend/src/app/assets/assets.component.ts @@ -30,10 +30,7 @@ export class AssetsComponent implements OnInit { ) { } ngOnInit() { - this.itemsPerPage = Math.round(this.contentSpace / this.fiveItemsPxSize) * 5; - if (this.itemsPerPage === 5) { - this.itemsPerPage = 10; - } + this.itemsPerPage = Math.max(Math.round(this.contentSpace / this.fiveItemsPxSize) * 5, 10); setTimeout(() => this.getAssets()); diff --git a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts index bbba41b05..2ab086746 100644 --- a/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts +++ b/frontend/src/app/components/mempool-blocks/mempool-blocks.component.ts @@ -109,7 +109,7 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy { } reduceMempoolBlocksToFitScreen(blocks: MempoolBlock[]): MempoolBlock[] { - const blocksAmount = Math.max(1, Math.floor(window.innerWidth / 2 / (this.blockWidth + this.blockPadding))); + const blocksAmount = Math.max(2, Math.floor(window.innerWidth / 2 / (this.blockWidth + this.blockPadding))); while (blocks.length > blocksAmount) { const block = blocks.pop(); const lastBlock = blocks[blocks.length - 1];