Merge pull request #6312 from rodribp/rodribp/fix-eta-changes

Fix: Transaction's ETA changes on reload page
This commit is contained in:
mononaut 2026-02-18 13:20:35 +09:00 committed by GitHub
commit 07e811e52a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

3
contributors/rodribp.txt Normal file
View file

@ -0,0 +1,3 @@
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of February 13, 2026.
Signed: rodribp

View file

@ -13,7 +13,9 @@ import {
retry,
startWith,
repeat,
take
take,
debounceTime,
distinctUntilChanged
} from 'rxjs/operators';
import { Transaction } from '@interfaces/electrs.interface';
import { of, merge, Subscription, Observable, Subject, from, throwError, combineLatest, BehaviorSubject, timer } from 'rxjs';
@ -834,6 +836,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.txChanged$,
]).pipe(
map(([position, mempoolBlocks, da, isAccelerated]) => {
if (!this.tx || !position || position.txid !== this.tx.txid) {
return null;
}
return this.etaService.calculateETA(
this.network,
this.tx,
@ -844,6 +849,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
isAccelerated,
this.accelerationPositions,
);
}),
distinctUntilChanged((prev: ETA | null, curr: ETA | null) => {
return prev === curr || (prev && curr && prev.time === curr.time && prev.blocks === curr.blocks);
})
);
}