Move block audit cache to apiService
This commit is contained in:
@@ -295,7 +295,6 @@ export class BlockComponent implements OnInit, OnDestroy {
|
||||
),
|
||||
!this.isAuditAvailableFromBlockHeight(block.height) ? of(null) : this.apiService.getBlockAudit$(block.id)
|
||||
.pipe(
|
||||
tap(() => this.cacheService.setBlockAuditLoaded(block.id)),
|
||||
catchError((err) => {
|
||||
this.overviewError = err;
|
||||
return of(null);
|
||||
|
||||
@@ -322,7 +322,6 @@ export class TrackerComponent implements OnInit, OnDestroy {
|
||||
})
|
||||
),
|
||||
fetchAudit ? this.apiService.getBlockAudit$(hash).pipe(
|
||||
tap((blockAudit) => this.cacheService.setBlockAuditLoaded(hash)),
|
||||
map(audit => {
|
||||
const isAdded = audit.addedTxs.includes(txid);
|
||||
const isPrioritized = audit.prioritizedTxs.includes(txid);
|
||||
|
||||
@@ -366,7 +366,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
const fetchAudit = auditAvailable && !isCoinbase;
|
||||
if (fetchAudit) {
|
||||
// If block audit is already cached, use it to get transaction audit
|
||||
const blockAuditLoaded = this.cacheService.getBlockAuditLoaded(hash);
|
||||
const blockAuditLoaded = this.apiService.getBlockAuditLoaded(hash);
|
||||
if (blockAuditLoaded) {
|
||||
return this.apiService.getBlockAudit$(hash).pipe(
|
||||
map(audit => {
|
||||
|
||||
Reference in New Issue
Block a user