From 4a2311f2aec17fc3719c3b599b7f750d6f6fe827 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 24 May 2022 16:03:20 +0530 Subject: [PATCH] Added loader to top-up confirmation --- index.html | 4 +++- scripts/fn_ui.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index aeab64c..6c8cc14 100644 --- a/index.html +++ b/index.html @@ -1083,7 +1083,9 @@
- +
+ +
diff --git a/scripts/fn_ui.js b/scripts/fn_ui.js index 5512f7f..18ef5e4 100644 --- a/scripts/fn_ui.js +++ b/scripts/fn_ui.js @@ -368,8 +368,9 @@ function completeCashToTokenRequest(request) { }) } -function confirmTopUp() { +function confirmTopUp(button) { const { message: { amount }, vectorClock, senderID } = floGlobals.cashierProcessingRequest; + buttonLoader(button, true); User.sendToken(senderID, amount, 'for cash-to-token').then(txid => { console.warn(`${amount} cash-to-token for ${senderID}`, txid); Cashier.finishRequest(floGlobals.cashierProcessingRequest, txid).then(result => { @@ -378,6 +379,7 @@ function confirmTopUp() { notify("Completed request", 'success'); hidePopup() }).catch(error => console.error(error)) + .finally(() => buttonLoader(button, false)) }).catch(error => console.error(error)) }