0.0.65
This commit is contained in:
parent
90af3b0404
commit
f69f8c1aff
@ -434,13 +434,6 @@ customElements.define('sm-input',
|
|||||||
this.input.blur()
|
this.input.blur()
|
||||||
}
|
}
|
||||||
|
|
||||||
preventNonNumericalInput = (e) => {
|
|
||||||
let keyCode = e.keyCode;
|
|
||||||
if (!((keyCode > 47 && keyCode < 56) || (keyCode > 36 && keyCode < 39) || (keyCode > 95 && keyCode < 106) || keyCode === 110 || (keyCode > 7 && keyCode < 19))) {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fireEvent = () => {
|
fireEvent = () => {
|
||||||
let event = new Event('input', {
|
let event = new Event('input', {
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
@ -529,10 +522,6 @@ customElements.define('sm-input',
|
|||||||
this.input.setAttribute('type', this.getAttribute('type'))
|
this.input.setAttribute('type', this.getAttribute('type'))
|
||||||
} else
|
} else
|
||||||
this.input.setAttribute('type', 'text')
|
this.input.setAttribute('type', 'text')
|
||||||
this.input.addEventListener('keydown', e => {
|
|
||||||
if (this.getAttribute('type') === 'number')
|
|
||||||
this.preventNonNumericalInput(e);
|
|
||||||
})
|
|
||||||
this.input.addEventListener('input', e => {
|
this.input.addEventListener('input', e => {
|
||||||
this.checkInput()
|
this.checkInput()
|
||||||
})
|
})
|
||||||
@ -774,10 +763,6 @@ customElements.define('sm-textarea',
|
|||||||
if (this.hasAttribute('helper-text')) {
|
if (this.hasAttribute('helper-text')) {
|
||||||
this.helperText.textContent = this.getAttribute('helper-text')
|
this.helperText.textContent = this.getAttribute('helper-text')
|
||||||
}
|
}
|
||||||
this.input.addEventListener('keydown', e => {
|
|
||||||
if (this.getAttribute('type') === 'number')
|
|
||||||
this.preventNonNumericalInput(e);
|
|
||||||
})
|
|
||||||
this.input.addEventListener('input', e => {
|
this.input.addEventListener('input', e => {
|
||||||
this.checkInput()
|
this.checkInput()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -895,6 +895,7 @@ sm-panel {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
.request.placeholder {
|
.request.placeholder {
|
||||||
|
pointer-events: none;
|
||||||
animation: pulse infinite 0.6s alternate;
|
animation: pulse infinite 0.6s alternate;
|
||||||
}
|
}
|
||||||
.request.placeholder h4, .request.placeholder h5 {
|
.request.placeholder h4, .request.placeholder h5 {
|
||||||
@ -1257,6 +1258,7 @@ sm-panel {
|
|||||||
margin-left: 0.4rem;
|
margin-left: 0.4rem;
|
||||||
}
|
}
|
||||||
.activity.placeholder {
|
.activity.placeholder {
|
||||||
|
pointer-events: none;
|
||||||
animation: pulse infinite 0.6s alternate;
|
animation: pulse infinite 0.6s alternate;
|
||||||
}
|
}
|
||||||
.activity.placeholder .activity-type,
|
.activity.placeholder .activity-type,
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -911,6 +911,7 @@ sm-panel{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.placeholder{
|
&.placeholder{
|
||||||
|
pointer-events: none;
|
||||||
h4, h5{
|
h4, h5{
|
||||||
padding: 0.5rem 0;
|
padding: 0.5rem 0;
|
||||||
background: rgba(var(--text-color), 0.06);
|
background: rgba(var(--text-color), 0.06);
|
||||||
@ -1301,6 +1302,7 @@ sm-panel{
|
|||||||
margin-left: 0.4rem;
|
margin-left: 0.4rem;
|
||||||
}
|
}
|
||||||
&.placeholder{
|
&.placeholder{
|
||||||
|
pointer-events: none;
|
||||||
animation: pulse infinite 0.6s alternate;
|
animation: pulse infinite 0.6s alternate;
|
||||||
.activity-type,
|
.activity-type,
|
||||||
.activity-receiver{
|
.activity-receiver{
|
||||||
|
|||||||
53
index.html
53
index.html
@ -1165,7 +1165,7 @@
|
|||||||
return card;
|
return card;
|
||||||
},
|
},
|
||||||
activityCard(obj) {
|
activityCard(obj) {
|
||||||
let { type, amount, timeStamp, receiver, upi_txid, receiverUPI, processed } = obj;
|
let { type, amount, timeStamp, receiver, upi_txid, receiverUPI, processed, fromCashier, toCashier } = obj;
|
||||||
let card = document.createElement('div'),
|
let card = document.createElement('div'),
|
||||||
composition = ``,
|
composition = ``,
|
||||||
icon,
|
icon,
|
||||||
@ -1180,7 +1180,9 @@
|
|||||||
'data-amount': amount,
|
'data-amount': amount,
|
||||||
'data-upi-txid': upi_txid,
|
'data-upi-txid': upi_txid,
|
||||||
'data-receiver-upi': receiverUPI,
|
'data-receiver-upi': receiverUPI,
|
||||||
'data-pending': processed
|
'data-pending': processed,
|
||||||
|
'data-from-cashier': fromCashier,
|
||||||
|
'data-to-cashier': toCashier
|
||||||
})
|
})
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'sent':
|
case 'sent':
|
||||||
@ -1267,6 +1269,10 @@
|
|||||||
<polyline points="47 32.26 32 32.26 32 12.26"/>
|
<polyline points="47 32.26 32 32.26 32 12.26"/>
|
||||||
</svg>`
|
</svg>`
|
||||||
}
|
}
|
||||||
|
if(fromCashier)
|
||||||
|
transaction = 'Received from cashier'
|
||||||
|
if(toCashier)
|
||||||
|
transaction = 'Sent to cashier'
|
||||||
composition += `
|
composition += `
|
||||||
${icon}
|
${icon}
|
||||||
<h4 class="activity-type">${transaction} ${status}</h4>`
|
<h4 class="activity-type">${transaction} ${status}</h4>`
|
||||||
@ -2101,7 +2107,7 @@
|
|||||||
|
|
||||||
let currentRequest = null;
|
let currentRequest = null;
|
||||||
document.getElementById('activity_page').addEventListener('click', (e) => {
|
document.getElementById('activity_page').addEventListener('click', (e) => {
|
||||||
if (e.target.closest('.activity:not(.placeholder)')) {
|
if (e.target.closest('.activity')) {
|
||||||
currentRequest = e.target.closest('.activity')
|
currentRequest = e.target.closest('.activity')
|
||||||
showTransactionDetails({
|
showTransactionDetails({
|
||||||
type: currentRequest.dataset.type,
|
type: currentRequest.dataset.type,
|
||||||
@ -2110,7 +2116,9 @@
|
|||||||
receiver: currentRequest.dataset.receiver,
|
receiver: currentRequest.dataset.receiver,
|
||||||
upiTxId: currentRequest.dataset.upiTxid,
|
upiTxId: currentRequest.dataset.upiTxid,
|
||||||
receiverUPI: currentRequest.dataset.receiverUpi,
|
receiverUPI: currentRequest.dataset.receiverUpi,
|
||||||
processed: currentRequest.dataset.pending
|
processed: currentRequest.dataset.pending,
|
||||||
|
toCashier: currentRequest.dataset.toCashier,
|
||||||
|
fromCashier: currentRequest.dataset.fromCashier
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -2149,7 +2157,7 @@
|
|||||||
let paymentRequestId = currentPaymentRequest.dataset.paymentRequestId;
|
let paymentRequestId = currentPaymentRequest.dataset.paymentRequestId;
|
||||||
if (await confirmation(`Do want to decline this request?`, 'No', 'Decline')) {
|
if (await confirmation(`Do want to decline this request?`, 'No', 'Decline')) {
|
||||||
const all_reqs = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
const all_reqs = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
||||||
.TYPE_REQUEST_PAYMENT, "0").reverse());
|
.TYPE_REQUEST_PAYMENT, "0"));
|
||||||
|
|
||||||
const original_req = all_reqs.filter(f => f.message.pay_req_id === paymentRequestId)
|
const original_req = all_reqs.filter(f => f.message.pay_req_id === paymentRequestId)
|
||||||
.map(m => m.message)[0];
|
.map(m => m.message)[0];
|
||||||
@ -2221,7 +2229,7 @@
|
|||||||
showReportButton = document.getElementById('show_report_btn')
|
showReportButton = document.getElementById('show_report_btn')
|
||||||
|
|
||||||
function showTransactionDetails(obj) {
|
function showTransactionDetails(obj) {
|
||||||
let { type, timeStamp, amount, receiver, upiTxId, receiverUPI, processed } = obj;
|
let { type, timeStamp, amount, receiver, upiTxId, receiverUPI, processed, fromCashier, toCashier } = obj;
|
||||||
let composition = ``,
|
let composition = ``,
|
||||||
icon,
|
icon,
|
||||||
transaction,
|
transaction,
|
||||||
@ -2337,6 +2345,16 @@
|
|||||||
<h5>Sent to cashier UPI ID</h5>
|
<h5>Sent to cashier UPI ID</h5>
|
||||||
<strong>${receiverUPI}</strong>
|
<strong>${receiverUPI}</strong>
|
||||||
`
|
`
|
||||||
|
if(fromCashier !== 'undefined'){
|
||||||
|
composition += `
|
||||||
|
<p>You have received ₹${amount} from our cashier. Your deposit request was completed successfully.</p>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
if(toCashier !== 'undefined'){
|
||||||
|
composition += `
|
||||||
|
<p>You sent ₹${amount} to our cashier.</p>
|
||||||
|
`
|
||||||
|
}
|
||||||
composition += `<h5 id="transaction_time">${formatedTime(timeStamp)}</h5>`
|
composition += `<h5 id="transaction_time">${formatedTime(timeStamp)}</h5>`
|
||||||
transactionDetails.innerHTML = composition
|
transactionDetails.innerHTML = composition
|
||||||
transactionType.textContent = type
|
transactionType.textContent = type
|
||||||
@ -12711,7 +12729,7 @@
|
|||||||
} else {
|
} else {
|
||||||
if (payingRequested) {
|
if (payingRequested) {
|
||||||
const all_reqs = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
const all_reqs = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
||||||
.TYPE_REQUEST_PAYMENT, "0").reverse());
|
.TYPE_REQUEST_PAYMENT, "0"));
|
||||||
|
|
||||||
const original_req = all_reqs
|
const original_req = all_reqs
|
||||||
.filter(f => f.message.pay_req_id === currentPaymentRequest.dataset.paymentRequestId)
|
.filter(f => f.message.pay_req_id === currentPaymentRequest.dataset.paymentRequestId)
|
||||||
@ -12735,7 +12753,7 @@
|
|||||||
}
|
}
|
||||||
hidePopup()
|
hidePopup()
|
||||||
showTransactionStatus('success', 'Rupee Sent', 'It may take upto 48 working hours for transaction to be completed.', flo_txid);
|
showTransactionStatus('success', 'Rupee Sent', 'It may take upto 48 working hours for transaction to be completed.', flo_txid);
|
||||||
sentActivityContainer.prepend(render.activityCard({ type: 'sent', amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, token_txid: flo_txid, receiver: token_receiver }))
|
//sentActivityContainer.prepend(render.activityCard({ type: 'sent', amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, token_txid: flo_txid, receiver: token_receiver }))
|
||||||
refresh_balance()
|
refresh_balance()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -13153,12 +13171,9 @@
|
|||||||
|
|
||||||
await token_app.actions.retrieveLatestContent();
|
await token_app.actions.retrieveLatestContent();
|
||||||
|
|
||||||
const deposit_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_DEPOSITS, "0")
|
let deposit_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_DEPOSITS, "0"));
|
||||||
.reverse());
|
const withdraw_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_WITHDRAWS,"0").reverse());
|
||||||
const withdraw_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_WITHDRAWS,
|
const user_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_MSGES, "0").reverse());
|
||||||
"0").reverse());
|
|
||||||
const user_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations.TYPE_MSGES, "0")
|
|
||||||
.reverse());
|
|
||||||
const pay_thru_cashier_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
const pay_thru_cashier_msg = removeDuplicates(floDapps.getNextGeneralData(token_app.master_configurations
|
||||||
.TYPE_PAY_THROUGH_CASHIER, "0").reverse());
|
.TYPE_PAY_THROUGH_CASHIER, "0").reverse());
|
||||||
|
|
||||||
@ -13168,6 +13183,8 @@
|
|||||||
const processed_deposits_upis = Object.values(processed_deposits).map(m => m.message.user_upi_txid);
|
const processed_deposits_upis = Object.values(processed_deposits).map(m => m.message.user_upi_txid);
|
||||||
console.log(processed_deposits_upis)
|
console.log(processed_deposits_upis)
|
||||||
|
|
||||||
|
deposit_msg = deposit_msg.sort((a, b) => parseInt(b.vectorClock.split('_')[0]) - parseInt(a.vectorClock.split('_')[0]))
|
||||||
|
|
||||||
console.log(deposit_msg, withdraw_msg, user_msg)
|
console.log(deposit_msg, withdraw_msg, user_msg)
|
||||||
for (usr_deposits of deposit_msg) {
|
for (usr_deposits of deposit_msg) {
|
||||||
let {
|
let {
|
||||||
@ -13582,8 +13599,8 @@
|
|||||||
let { tokenAmount, flodata } = transaction.parsedFloData,
|
let { tokenAmount, flodata } = transaction.parsedFloData,
|
||||||
receiver = flodata.match(/\b\w{34,34}\b/),
|
receiver = flodata.match(/\b\w{34,34}\b/),
|
||||||
timeStamp = transaction.transactionDetails.time * 1000
|
timeStamp = transaction.transactionDetails.time * 1000
|
||||||
if (receiver === '' || typeof receiver === 'undefined' || receiver === null || token_app.master_configurations.cashiers[receiver]) continue;
|
if (receiver === '' || typeof receiver === 'undefined' || receiver === null) continue;
|
||||||
frag.append(render.activityCard({ type: 'sent', amount: tokenAmount, receiver, timeStamp }))
|
frag.append(render.activityCard({ type: 'sent', amount: tokenAmount, receiver, timeStamp, toCashier: token_app.master_configurations.cashiers[receiver] }))
|
||||||
}
|
}
|
||||||
sentActivityContainer.innerHTML = ''
|
sentActivityContainer.innerHTML = ''
|
||||||
sentActivityContainer.append(frag)
|
sentActivityContainer.append(frag)
|
||||||
@ -13602,8 +13619,8 @@
|
|||||||
sender = transaction.transactionDetails.vin[0].addr,
|
sender = transaction.transactionDetails.vin[0].addr,
|
||||||
timeStamp = transaction.transactionDetails.time * 1000
|
timeStamp = transaction.transactionDetails.time * 1000
|
||||||
|
|
||||||
if (sender === '' || typeof sender === 'undefined' || sender === null || token_app.master_configurations.cashiers[sender]) continue;
|
if (sender === '' || typeof sender === 'undefined' || sender === null) continue;
|
||||||
frag.append(render.activityCard({ type: 'received', amount: tokenAmount, receiver: sender, timeStamp }))
|
frag.append(render.activityCard({ type: 'received', amount: tokenAmount, receiver: sender, timeStamp, fromCashier: token_app.master_configurations.cashiers[sender] }))
|
||||||
}
|
}
|
||||||
receivedActivityContainer.innerHTML = ''
|
receivedActivityContainer.innerHTML = ''
|
||||||
receivedActivityContainer.append(frag)
|
receivedActivityContainer.append(frag)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user