[faucet] improve feedback upon success
This commit is contained in:
parent
6b16b2d651
commit
3bbdf6fb25
@ -6,7 +6,14 @@
|
|||||||
|
|
||||||
<div class="faucet-container text-center">
|
<div class="faucet-container text-center">
|
||||||
|
|
||||||
@if (loading) {
|
@if (txid) {
|
||||||
|
<div class="alert alert-success w-100 text-truncate">
|
||||||
|
<fa-icon [icon]="['fas', 'circle-check']"></fa-icon>
|
||||||
|
Sent!
|
||||||
|
<a class="text-primary" [href]="'/testnet4/txid/' + txid">{{ txid }}</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@else if (loading) {
|
||||||
<p>Loading faucet...</p>
|
<p>Loading faucet...</p>
|
||||||
<div class="spinner-border text-light"></div>
|
<div class="spinner-border text-light"></div>
|
||||||
} @else if (!user) {
|
} @else if (!user) {
|
||||||
|
@ -103,6 +103,7 @@ export class FaucetComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
requestCoins(): void {
|
requestCoins(): void {
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
this.txid = '';
|
||||||
this.stateService.markBlock$.next({});
|
this.stateService.markBlock$.next({});
|
||||||
this.servicesApiService.requestTestnet4Coins$(this.faucetForm.get('address')?.value, parseInt(this.faucetForm.get('satoshis')?.value))
|
this.servicesApiService.requestTestnet4Coins$(this.faucetForm.get('address')?.value, parseInt(this.faucetForm.get('satoshis')?.value))
|
||||||
.subscribe({
|
.subscribe({
|
||||||
@ -110,6 +111,7 @@ export class FaucetComponent implements OnInit, OnDestroy {
|
|||||||
this.txid = response.txid;
|
this.txid = response.txid;
|
||||||
this.websocketService.startTrackTransaction(this.txid);
|
this.websocketService.startTrackTransaction(this.txid);
|
||||||
this.audioService.playSound('cha-ching');
|
this.audioService.playSound('cha-ching');
|
||||||
|
this.cd.markForCheck();
|
||||||
}),
|
}),
|
||||||
error: (response: HttpErrorResponse) => {
|
error: (response: HttpErrorResponse) => {
|
||||||
this.error = response.error;
|
this.error = response.error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user