Infinite scroll replaces "load more" buttons.

This commit is contained in:
softsimon
2020-03-01 03:32:12 +07:00
parent 3d575035a1
commit ab9f39884f
11 changed files with 34 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import { Component, OnInit, Input, ChangeDetectionStrategy, OnChanges, ChangeDetectorRef } from '@angular/core';
import { Component, OnInit, Input, ChangeDetectionStrategy, OnChanges, ChangeDetectorRef, Output, EventEmitter } from '@angular/core';
import { StateService } from '../../services/state.service';
import { Observable, forkJoin } from 'rxjs';
import { Block, Outspend, Transaction } from '../../interfaces/electrs.interface';
@@ -15,6 +15,8 @@ export class TransactionsListComponent implements OnInit, OnChanges {
@Input() showConfirmations = false;
@Input() transactionPage = false;
@Output() loadMore = new EventEmitter();
latestBlock$: Observable<Block>;
outspends: Outspend[] = [];
@@ -53,6 +55,10 @@ export class TransactionsListComponent implements OnInit, OnChanges {
});
}
onScroll() {
this.loadMore.emit();
}
getTotalTxOutput(tx: any) {
return tx.vout.map((v: any) => v.value || 0).reduce((a: number, b: number) => a + b);
}