fixed payments history not sorted
This commit is contained in:
parent
1b90cd89a3
commit
c4686f6446
@ -377,12 +377,12 @@ function confirmTopUp(button) {
|
|||||||
buttonLoader(button, true);
|
buttonLoader(button, true);
|
||||||
floBlockchainAPI.getBalance(senderID).then(async user_balance => {
|
floBlockchainAPI.getBalance(senderID).then(async user_balance => {
|
||||||
let floAmt = floGlobals.sendAmt;
|
let floAmt = floGlobals.sendAmt;
|
||||||
if(user_balance < floGlobals.settings.user_flo_threshold){
|
if (user_balance < floGlobals.settings.user_flo_threshold) {
|
||||||
let cur_rate = (await floExchangeAPI.getRates("FLO")).rate;
|
let cur_rate = (await floExchangeAPI.getRates("FLO")).rate;
|
||||||
floAmt = floGlobals.settings.send_user_flo;
|
floAmt = floGlobals.settings.send_user_flo;
|
||||||
tokenAmt -= cur_rate * floAmt;
|
tokenAmt -= cur_rate * floAmt;
|
||||||
}
|
}
|
||||||
User.sendToken(senderID, tokenAmt, 'for cash-to-token', {sendAmt: floAmt}).then(txid => {
|
User.sendToken(senderID, tokenAmt, 'for cash-to-token', { sendAmt: floAmt }).then(txid => {
|
||||||
console.warn(`${amount} (${tokenAmt}|${floAmt}) cash-to-token for ${senderID}`, txid);
|
console.warn(`${amount} (${tokenAmt}|${floAmt}) cash-to-token for ${senderID}`, txid);
|
||||||
Cashier.finishRequest(floGlobals.cashierProcessingRequest, txid).then(result => {
|
Cashier.finishRequest(floGlobals.cashierProcessingRequest, txid).then(result => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
@ -422,10 +422,10 @@ function declineTopUp() {
|
|||||||
function completeTokenToCashRequest(request) {
|
function completeTokenToCashRequest(request) {
|
||||||
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request;
|
const { vectorClock, senderID, message: { token_txid, amount, upi_id } } = request;
|
||||||
var upiID;
|
var upiID;
|
||||||
if(upi_id instanceof Object && "secret" in upi_id){
|
if (upi_id instanceof Object && "secret" in upi_id) {
|
||||||
try {
|
try {
|
||||||
upiID = floCrypto.decryptData(upi_id, myPrivKey);
|
upiID = floCrypto.decryptData(upi_id, myPrivKey);
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
console.error("UPI ID is not encrypted with a proper key", error);
|
console.error("UPI ID is not encrypted with a proper key", error);
|
||||||
return notify("Invalid UPI ID", 'error');
|
return notify("Invalid UPI ID", 'error');
|
||||||
}
|
}
|
||||||
@ -619,6 +619,8 @@ const render = {
|
|||||||
let propToCheck = filter === 'sent' ? 'sender' : 'receiver';
|
let propToCheck = filter === 'sent' ? 'sender' : 'receiver';
|
||||||
paymentTransactions = paymentTransactions.filter(v => v[propToCheck] === myFloID)
|
paymentTransactions = paymentTransactions.filter(v => v[propToCheck] === myFloID)
|
||||||
}
|
}
|
||||||
|
// solve issue at backend
|
||||||
|
paymentTransactions.sort((a, b) => b.time - a.time);
|
||||||
if (paymentsHistoryLoader) {
|
if (paymentsHistoryLoader) {
|
||||||
paymentsHistoryLoader.update(paymentTransactions);
|
paymentsHistoryLoader.update(paymentTransactions);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user