From 73bc36316e97e419f8cab31485fa3267513f7492 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 24 May 2022 11:59:44 +0530 Subject: [PATCH 1/3] minor cashier-side bug fix --- scripts/fn_ui.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/fn_ui.js b/scripts/fn_ui.js index 0729d8b..5512f7f 100644 --- a/scripts/fn_ui.js +++ b/scripts/fn_ui.js @@ -335,11 +335,10 @@ cashierUI.renderRequests = function (requests, error = null) { return console.error(error); else if (typeof requests !== "object" || requests === null) return; - const frag = document.createDocumentFragment(); for (let transactionID in requests) { const { note, tag } = requests[transactionID]; let status = tag ? 'done' : (note ? 'failed' : "pending"); - getRef('cashier_pending_request_list').querySelectorAll(`[data-vc="${transactionID}"]`).forEach(card => card.remove()); + getRef('cashier_requests_wrapper').querySelectorAll(`[data-vc="${transactionID}"]`).forEach(card => card.remove()); getRef(status === 'pending' ? 'cashier_pending_request_list' : 'cashier_processed_request_list').prepend(render.cashierRequestCard(requests[transactionID])) } } From 4a2311f2aec17fc3719c3b599b7f750d6f6fe827 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 24 May 2022 16:03:20 +0530 Subject: [PATCH 2/3] 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)) } From 7a4bd4ee7deca6bce598a81e4c1853a656ce40ee Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Tue, 24 May 2022 17:17:05 +0530 Subject: [PATCH 3/3] Added blockchain transaction link for withdrawal --- index.html | 2 ++ scripts/fn_ui.js | 3 +++ scripts/std_ui.js | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 6c8cc14..9bb3887 100644 --- a/index.html +++ b/index.html @@ -952,6 +952,8 @@

Sent transfer to bank request

This may take upto 30 mins to complete

+ Check transaction on + blockchain
{ console.warn(`Withdraw ${amount} from cashier ${cashier}`, txid); User.tokenToCash(cashier, amount, txid, upiId).then(result => { showChildElement('withdraw_wallet_process', 1); refreshBalance(); + getRef('withdrawal_blockchain_link').classList.remove('hide'); + getRef('withdrawal_blockchain_link').href = `https://flosight.duckdns.org/tx/${txid}` console.log(result); }).catch(error => { getRef('withdrawal_failed_reason').textContent = error; diff --git a/scripts/std_ui.js b/scripts/std_ui.js index cd57f13..c380728 100644 --- a/scripts/std_ui.js +++ b/scripts/std_ui.js @@ -452,11 +452,11 @@ async function showPage(targetPage, options = {}) { } else if (params.type === 'wallet') { transactionDetails = User.cashierRequests[params.transactionId] console.log(transactionDetails) - const { message: { amount, mode, upi_id, upi_txid }, note, tag } = transactionDetails + const { message: { amount, mode, upi_id, upi_txid, token_txid }, note, tag } = transactionDetails status = tag ? tag : (note ? 'REJECTED' : "PENDING"); getRef('transaction__type').textContent = mode === 'cash-to-token' ? 'Wallet top-up' : 'Withdraw'; if (status === 'COMPLETED') { - getRef('transaction__link').href = `https://flosight.duckdns.org/tx/${note}` + getRef('transaction__link').href = `https://flosight.duckdns.org/tx/${mode === 'cash-to-token' ? note : token_txid}` getRef('transaction__link').classList.remove('hide') } else if (status === 'REJECTED') { getRef('transaction__note').innerHTML = ` ${note.split(':')[1]}`