Transition new blocks from the mempool onto the blockchain.

Chime on new blocks.
fixes #47
fixes #84
This commit is contained in:
softsimon
2020-06-10 23:52:14 +07:00
parent ea708de9fb
commit 36e46249b5
22 changed files with 124 additions and 60 deletions

View File

@@ -5,17 +5,20 @@ import { Injectable } from '@angular/core';
})
export class AudioService {
audio = new Audio();
isPlaying = false;
constructor() { }
public playSound(name: 'magic' | 'chime' | 'cha-ching') {
try {
this.audio.src = '../../../resources/sounds/' + name + '.mp3';
this.audio.load();
this.audio.play();
} catch (e) {
console.log('Play sound failed', e);
public playSound(name: 'magic' | 'chime' | 'cha-ching' | 'bright-harmony') {
if (this.isPlaying) {
return;
}
this.isPlaying = true;
this.audio.src = '../../../resources/sounds/' + name + '.mp3';
this.audio.load();
this.audio.play().catch((e) => {
console.log('Play sound failed', e);
});
setTimeout(() => this.isPlaying = false, 100);
}
}