Add button to scroll back to tip of blockchain

This commit is contained in:
Mononaut
2023-01-26 11:55:26 -06:00
parent 94add379d0
commit da51557960
4 changed files with 54 additions and 7 deletions

View File

@@ -250,6 +250,10 @@ export class StartComponent implements OnInit, OnDestroy {
};
}
resetScroll(): void {
this.scrollToBlock(this.chainTip);
}
getPageIndexOf(height: number): number {
const delta = this.chainTip - 8 - height;
return Math.max(0, Math.floor(delta / this.blocksPerPage) + 1);