Adding missing error output on /blocks page.
This commit is contained in:
@@ -15,7 +15,7 @@ import { map } from 'rxjs/operators';
|
||||
})
|
||||
export class LatestBlocksComponent implements OnInit, OnDestroy {
|
||||
network$: Observable<string>;
|
||||
|
||||
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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user