diff --git a/frontend/src/app/dashboard/dashboard.component.ts b/frontend/src/app/dashboard/dashboard.component.ts index f6f17bec4..005c8c45c 100644 --- a/frontend/src/app/dashboard/dashboard.component.ts +++ b/frontend/src/app/dashboard/dashboard.component.ts @@ -189,17 +189,7 @@ export class DashboardComponent implements OnInit, OnDestroy, AfterViewInit { }) ); - this.transactions$ = this.stateService.transactions$ - .pipe( - scan((acc, tx) => { - if (acc.find((t) => t.txid == tx.txid)) { - return acc; - } - acc.unshift(tx); - acc = acc.slice(0, 6); - return acc; - }, []), - ); + this.transactions$ = this.stateService.transactions$; this.blocks$ = this.stateService.blocks$ .pipe( diff --git a/frontend/src/app/services/state.service.ts b/frontend/src/app/services/state.service.ts index 8957af736..a06e98b1c 100644 --- a/frontend/src/app/services/state.service.ts +++ b/frontend/src/app/services/state.service.ts @@ -101,7 +101,7 @@ export class StateService { lightningChanged$ = new ReplaySubject(1); blocksSubject$ = new BehaviorSubject([]); blocks$: Observable; - transactions$ = new ReplaySubject(6); + transactions$ = new BehaviorSubject(null); conversions$ = new ReplaySubject(1); bsqPrice$ = new ReplaySubject(1); mempoolInfo$ = new ReplaySubject(1); @@ -217,7 +217,7 @@ export class StateService { } this.networkChanged$.subscribe((network) => { - this.transactions$ = new ReplaySubject(6); + this.transactions$ = new BehaviorSubject(null); this.blocksSubject$.next([]); }); diff --git a/frontend/src/app/services/websocket.service.ts b/frontend/src/app/services/websocket.service.ts index b4625b87c..5f355a709 100644 --- a/frontend/src/app/services/websocket.service.ts +++ b/frontend/src/app/services/websocket.service.ts @@ -343,7 +343,7 @@ export class WebsocketService { } if (response.transactions) { - response.transactions.forEach((tx) => this.stateService.transactions$.next(tx)); + this.stateService.transactions$.next(response.transactions.slice(0, 6)); } if (response['bsq-price']) {