mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 06:47:52 +01:00
Merge pull request #4906 from mempool/mononaut/acceleration-harmony
Acceleration sound
This commit is contained in:
commit
ed6af8f560
1 changed files with 13 additions and 0 deletions
|
@ -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<Acceleration[]>;
|
||||
loadingBlocks: boolean = true;
|
||||
webGlEnabled = true;
|
||||
seen: Set<string> = 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(),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue