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

This commit is contained in:
Miguel Medeiros authored and GitHub committed 2021-05-20 02:03:59 +04:00
1 parent 794bc99cb6
commit e70fd0045d
1 file changed
+8 -1
@@ -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) {