mirror of
https://github.com/mempool/mempool.git
synced 2025-02-22 14:22:44 +01:00
Acceleration sounds
This commit is contained in:
parent
99b57bbec0
commit
6014469513
5 changed files with 9 additions and 2 deletions
|
@ -4,6 +4,7 @@ import { Subscription, catchError, of, tap } from 'rxjs';
|
|||
import { StorageService } from '../../services/storage.service';
|
||||
import { Transaction } from '../../interfaces/electrs.interface';
|
||||
import { nextRoundNumber } from '../../shared/common.utils';
|
||||
import { AudioService } from '../../services/audio.service';
|
||||
|
||||
export type AccelerationEstimate = {
|
||||
txSummary: TxSummary;
|
||||
|
@ -63,6 +64,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||
constructor(
|
||||
private apiService: ApiService,
|
||||
private storageService: StorageService,
|
||||
private audioService: AudioService,
|
||||
private cd: ChangeDetectorRef
|
||||
) { }
|
||||
|
||||
|
@ -186,6 +188,7 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges
|
|||
this.userBid
|
||||
).subscribe({
|
||||
next: () => {
|
||||
this.audioService.playSound('ascend-chime-cartoon');
|
||||
this.showSuccess = true;
|
||||
this.scrollToPreviewWithTimeout('successAlert', 'center');
|
||||
this.estimateSubscription.unsubscribe();
|
||||
|
|
|
@ -439,7 +439,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||
block_time: block.timestamp,
|
||||
};
|
||||
this.stateService.markBlock$.next({ blockHeight: block.height });
|
||||
this.audioService.playSound('magic');
|
||||
if (this.accelerationInfo && ['accelerating', 'mined', 'completed'].includes(this.accelerationInfo.status)) {
|
||||
this.audioService.playSound('wind-chimes-harp-ascend');
|
||||
} else {
|
||||
this.audioService.playSound('magic');
|
||||
}
|
||||
this.fetchAcceleration$.next(block.id);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export class AudioService {
|
|||
} catch (e) {}
|
||||
}
|
||||
|
||||
public playSound(name: 'magic' | 'chime' | 'cha-ching' | 'bright-harmony') {
|
||||
public playSound(name: 'magic' | 'chime' | 'cha-ching' | 'bright-harmony' | 'wind-chimes-harp-ascend' | 'ascend-chime-cartoon') {
|
||||
if (this.isPlaying || !this.audio) {
|
||||
return;
|
||||
}
|
||||
|
|
BIN
frontend/src/resources/sounds/ascend-chime-cartoon.mp3
Normal file
BIN
frontend/src/resources/sounds/ascend-chime-cartoon.mp3
Normal file
Binary file not shown.
BIN
frontend/src/resources/sounds/wind-chimes-harp-ascend.mp3
Normal file
BIN
frontend/src/resources/sounds/wind-chimes-harp-ascend.mp3
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue