Signing out will erase all the data stored in local storage and Indexed DB. This will remove
- saved private key, UPI addresses and contacts.
@@ -1279,7 +1276,7 @@
${transaction} ${status}
`
if (receiver)
composition += `
- ${allContacts[receiver] ? allContacts[receiver].name : receiver}
+ ${allContacts ? allContacts[receiver] ? allContacts[receiver].name : receiver: receiver}
`
composition += `
${sign} ₹${amount}
@@ -1829,6 +1826,7 @@
const loaderPage = document.getElementById('main_loader')
function showLoader() {
+ document.body.classList.remove('hide-completely')
loaderPage.classList.remove('hide-completely')
loader.classList.add('animate-loader')
document.querySelector('main').classList.add('hide-completely')
@@ -2295,8 +2293,8 @@
if (receiver !== 'undefined'){
transactionFloId = receiver
composition += `
- ${transaction}
${allContacts[receiver] ? allContacts[receiver].name : receiver}`
- if(floCrypto.validateAddr(receiver) && !allContacts[receiver])
+ ${transaction}
${allContacts ? allContacts[receiver] ? allContacts[receiver].name : receiver: receiver}`
+ if(!token_app.master_configurations.cashiers[myFloID] && floCrypto.validateAddr(receiver) && !allContacts[receiver])
composition += `Save this FLO address`
}
@@ -2311,6 +2309,12 @@
Sent to cashier UPI ID
${receiverUPI}
`
+ if(tokenTxId !== 'undefined'){
+ composition += `
+ FLO transaction ID
+ ${tokenTxId}
+ `
+ }
if(fromCashier !== 'undefined'){
composition += `
You have received ₹${amount} from RanchiMall Pay. Your deposit request was completed successfully.
@@ -2321,12 +2325,6 @@
You sent ₹${amount} to our cashier.
`
}
- if(tokenTxId !== 'undefined'){
- composition += `
- FLO transaction ID
- ${tokenTxId}
- `
- }
composition += `${formatedTime(timeStamp)}
`
transactionDetails.innerHTML = composition
transactionType.textContent = type
@@ -2529,15 +2527,9 @@
document.getElementById('navbar').classList.add('hide-completely')
document.getElementById('main_header').classList.add('hide-completely')
floDapps.clearCredentials()
- compactIDB.deleteDB().then((message) => {
- delete token_app.master_configurations;
- localStorage.removeItem(`defaultUPI${myFloID}`)
- onLoadStartUp()
- notifications.clearAll()
- notify('Logged out')
- }).catch((error) => {
- console.log(error)
- })
+ onLoadStartUp()
+ notifications.clearAll()
+ delete token_app.master_configurations;
}
}
@@ -12122,6 +12114,9 @@
showDepositRequests()
showWithdrawRequests()
showPayThruCashierRequests()
+ getSentRupeeList()
+
+ getReceivedRupeeList()
userType.forEach(user => user.textContent = 'Cashier')
showPage('deposit', 'deposit_page_btn')
}
@@ -12694,8 +12689,8 @@
flo_comment)
console.log(flo_txid);
if (typeof flo_txid !== "string") {
- showTransactionStatus('failure', `Transaction failed.`);
hidePopup()
+ showTransactionStatus('failure', `Transaction failed.`);
return false;
} else {
if (payingRequested) {
@@ -12724,7 +12719,7 @@
}
hidePopup()
showTransactionStatus('success', 'Rupee Sent', 'It may take upto 48 working hours for transaction to be completed.', flo_txid);
- sentActivityContainer.prepend(render.activityCard({ type: 'sent', proceesed: false, amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, token_txid: flo_txid, receiver: token_receiver }))
+ sentActivityContainer.prepend(render.activityCard({ type: 'sent', processed: false, amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, tokenTxId: flo_txid, receiver: token_receiver }))
refresh_balance()
return true;
}
@@ -13243,18 +13238,29 @@
}
}
+ async function getReceiver(vout){
+ for(v of vout){
+ for(addr of v.scriptPubKey.addresses){
+ if(addr !== myFloID)
+ return addr
+ }
+ }
+ }
+
async function getSentRupeeList() {
try {
let data = await ajaxGet(`https://ranchimallflo.duckdns.org/api/v1.0/getTokenTransactions?token=rupee&senderFloAddress=${myFloID}`)
let transactions = data.transactions
+ console.log(transactions, data)
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
for (transaction of sortedTransactions) {
let { tokenAmount, flodata } = transaction.parsedFloData,
- {time, txid} = transaction.transactionDetails,
- receiver = flodata.match(/\b\w{34,34}\b/),
+ {time, txid, vout} = transaction.transactionDetails,
+ receiver = flodata.match(/\b\w{34,34}\b/) ? flodata.match(/\b\w{34,34}\b/) : await getReceiver(vout),
timeStamp = time * 1000,
confirmations = await ajaxGet(`https://flosight.duckdns.org/api/tx/${txid}`),
processed = confirmations.confirmations > 3 ? true : false
+
if (receiver === '' || typeof receiver === 'undefined' || receiver === null) continue;
frag.append(render.activityCard({ type: 'sent', amount: tokenAmount, tokenTxId: txid, receiver, timeStamp, processed, toCashier: token_app.master_configurations.cashiers[receiver] }))
}
@@ -13271,7 +13277,7 @@
let transactions = data.transactions
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
for (transaction of sortedTransactions) {
- console.log(transaction)
+
let { tokenAmount, flodata } = transaction.parsedFloData,
{time, txid, vin} = transaction.transactionDetails,
sender = vin[0].addr,