From 32495736d450eb014f3d452b479aca87fe9e962d Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 6 Apr 2024 09:58:07 +0000 Subject: [PATCH] such bright wow harmony --- .../accelerator-dashboard.component.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts index 2524975e3..58bc43c42 100644 --- a/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts +++ b/frontend/src/app/components/acceleration/accelerator-dashboard/accelerator-dashboard.component.ts @@ -11,6 +11,7 @@ import TxView from '../../block-overview-graph/tx-view'; import { feeLevels, mempoolFeeColors } from '../../../app.constants'; import { ServicesApiServices } from '../../../services/services-api.service'; import { detectWebGL } from '../../../shared/graphs.utils'; +import { AudioService } from '../../../services/audio.service'; const acceleratedColor: Color = hexToColor('8F5FF6'); const normalColors = mempoolFeeColors.map(hex => hexToColor(hex.slice(0,6) + '5F')); @@ -32,6 +33,8 @@ export class AcceleratorDashboardComponent implements OnInit { minedAccelerations$: Observable; loadingBlocks: boolean = true; webGlEnabled = true; + seen: Set = new Set(); + firstLoad = true; graphHeight: number = 300; @@ -40,6 +43,7 @@ export class AcceleratorDashboardComponent implements OnInit { private ogService: OpenGraphService, private websocketService: WebsocketService, private serviceApiServices: ServicesApiServices, + private audioService: AudioService, private stateService: StateService, @Inject(PLATFORM_ID) private platformId: Object, ) { @@ -61,6 +65,15 @@ export class AcceleratorDashboardComponent implements OnInit { }), ); }), + tap(accelerations => { + if (!this.firstLoad && accelerations.some(acc => !this.seen.has(acc.txid))) { + this.audioService.playSound('bright-harmony'); + } + for(const acc of accelerations) { + this.seen.add(acc.txid); + } + this.firstLoad = false; + }), share(), );