diff --git a/frontend/src/app/components/latest-blocks/latest-blocks.component.html b/frontend/src/app/components/latest-blocks/latest-blocks.component.html index 882442ec4..ce9496657 100644 --- a/frontend/src/app/components/latest-blocks/latest-blocks.component.html +++ b/frontend/src/app/components/latest-blocks/latest-blocks.component.html @@ -46,4 +46,12 @@ + +
+ Error loading blocks +
+ {{ error.error }} +
+
+ diff --git a/frontend/src/app/components/latest-blocks/latest-blocks.component.ts b/frontend/src/app/components/latest-blocks/latest-blocks.component.ts index eb8b8236d..15b2843bd 100644 --- a/frontend/src/app/components/latest-blocks/latest-blocks.component.ts +++ b/frontend/src/app/components/latest-blocks/latest-blocks.component.ts @@ -15,7 +15,7 @@ import { map } from 'rxjs/operators'; }) export class LatestBlocksComponent implements OnInit, OnDestroy { network$: Observable; - + error: any; blocks: any[] = []; blockSubscription: Subscription; isLoading = true; @@ -86,6 +86,7 @@ export class LatestBlocksComponent implements OnInit, OnDestroy { .subscribe((blocks) => { this.blocks = blocks; this.isLoading = false; + this.error = undefined; this.latestBlockHeight = blocks[0].height; @@ -95,6 +96,12 @@ export class LatestBlocksComponent implements OnInit, OnDestroy { this.loadMore(chunks); } this.cd.markForCheck(); + }, + (error) => { + console.log(error); + this.error = error; + this.isLoading = false; + this.cd.markForCheck(); }); } @@ -107,12 +114,19 @@ export class LatestBlocksComponent implements OnInit, OnDestroy { .subscribe((blocks) => { this.blocks = this.blocks.concat(blocks); this.isLoading = false; + this.error = undefined; const chunksLeft = chunks - 1; if (chunksLeft > 0) { this.loadMore(chunksLeft); } this.cd.markForCheck(); + }, + (error) => { + console.log(error); + this.error = error; + this.isLoading = false; + this.cd.markForCheck(); }); }