Merge pull request #4512 from mempool/simon/acceleration-sounds
Acceleration sounds
This commit is contained in:
		
						commit
						fb61fddcc4
					
				| @ -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 }); | ||||
|         if (this.tx.acceleration || (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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user