From 80b8583e98dbaff359f1b76b87b874e2d61a3e92 Mon Sep 17 00:00:00 2001 From: Abhishek Sinha Date: Thu, 10 Sep 2020 15:31:48 +0530 Subject: [PATCH] fixed payment request functions --- index.html | 81 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/index.html b/index.html index 0463672..09d40b0 100644 --- a/index.html +++ b/index.html @@ -1655,7 +1655,14 @@ paymentRequestId = parent.dataset.paymentRequestId; if (await confirmation( `Do want to decline this request? This will remove the request.`)) { - payment_request_status(paymentRequestId, 'DECLINED') + + const all_reqs = floDapps.getNextGeneralData(token_app.master_configurations + .TYPE_REQUEST_PAYMENT, "0").reverse(); + + const original_req = all_reqs.filter(f=>f.message.pay_req_id===paymentRequestId) + .map(m=>m.message)[0]; + + payment_request_status(original_req, 'DECLINED') e.target.closest('.request').remove() } } @@ -11130,6 +11137,13 @@ return false; } } + + function delay(t, v) { + return new Promise(function(resolve) { + setTimeout(resolve.bind(null, v), t); + }); + } +