Fix tx-list load is being constantly triggered. (#531)

This commit is contained in:
Miguel Medeiros 2021-05-19 19:03:59 -03:00 committed by GitHub
parent 794bc99cb6
commit e70fd0045d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,14 @@ export class TransactionsListComponent implements OnInit, OnChanges {
}
onScroll() {
this.loadMore.emit();
const scrollHeight = document.body.scrollHeight;
const scrollTop = document.documentElement.scrollTop;
if(scrollHeight > 0){
const percentageScrolled = scrollTop * 100 / scrollHeight;
if(percentageScrolled > 90){
this.loadMore.emit();
}
}
}
getTotalTxOutput(tx: Transaction) {