Fix paid/pending invoice status UI and date handling
This commit is contained in:
16
app.js
16
app.js
@@ -458,6 +458,7 @@
|
|||||||
html += '<div class="summary-desc">' + desc.replace(/</g, '<') + '</div>';
|
html += '<div class="summary-desc">' + desc.replace(/</g, '<') + '</div>';
|
||||||
}
|
}
|
||||||
paymentSummary.innerHTML = html;
|
paymentSummary.innerHTML = html;
|
||||||
|
paymentSummary.classList.remove('paid-confirmed');
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePageTitle(xmrAmount, desc) {
|
function updatePageTitle(xmrAmount, desc) {
|
||||||
@@ -938,6 +939,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showPaidStatus(data) {
|
function showPaidStatus(data) {
|
||||||
|
if (!data.verified_at) {
|
||||||
|
data = Object.assign({}, data, { verified_at: Math.floor(Date.now() / 1000) });
|
||||||
|
}
|
||||||
|
|
||||||
paymentStatus.className = 'payment-status paid';
|
paymentStatus.className = 'payment-status paid';
|
||||||
|
|
||||||
// Stamp over QR + dim QR
|
// Stamp over QR + dim QR
|
||||||
@@ -962,13 +967,13 @@
|
|||||||
year: 'numeric', month: 'long', day: 'numeric'
|
year: 'numeric', month: 'long', day: 'numeric'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
hint.textContent = data.amount.toFixed(6) + ' XMR — TX ' +
|
hint.textContent = 'TX ' + data.tx_hash.substring(0, 8) + '...' + dateStr;
|
||||||
data.tx_hash.substring(0, 8) + '...' + dateStr;
|
|
||||||
hint.className = 'qr-hint paid-info';
|
hint.className = 'qr-hint paid-info';
|
||||||
}
|
}
|
||||||
|
|
||||||
paymentStatus.innerHTML = '';
|
paymentStatus.innerHTML = '';
|
||||||
lastPaidData = data;
|
lastPaidData = data;
|
||||||
|
paymentSummary.classList.add('paid-confirmed');
|
||||||
|
|
||||||
// Hide unnecessary buttons when paid
|
// Hide unnecessary buttons when paid
|
||||||
openWalletBtn.style.display = 'none';
|
openWalletBtn.style.display = 'none';
|
||||||
@@ -981,6 +986,7 @@
|
|||||||
function showPendingStatus(data) {
|
function showPendingStatus(data) {
|
||||||
var confs = data.confirmations || 0;
|
var confs = data.confirmations || 0;
|
||||||
paymentStatus.className = 'payment-status pending';
|
paymentStatus.className = 'payment-status pending';
|
||||||
|
paymentSummary.classList.remove('paid-confirmed');
|
||||||
qrContainer.classList.add('confirming');
|
qrContainer.classList.add('confirming');
|
||||||
|
|
||||||
var existingStamp = qrContainer.querySelector('.paid-stamp');
|
var existingStamp = qrContainer.querySelector('.paid-stamp');
|
||||||
@@ -993,8 +999,10 @@
|
|||||||
existingStamp.textContent = confs === 0 ? I18n.t('status_pending') : (confs + '/10');
|
existingStamp.textContent = confs === 0 ? I18n.t('status_pending') : (confs + '/10');
|
||||||
|
|
||||||
var hint = qrContainer.querySelector('.qr-hint');
|
var hint = qrContainer.querySelector('.qr-hint');
|
||||||
if (hint && !hint.classList.contains('paid-info')) {
|
if (hint) {
|
||||||
hint.textContent = data.amount.toFixed(6) + ' XMR — TX ' + data.tx_hash.substring(0, 8) + '...';
|
hint.textContent = 'TX ' + data.tx_hash.substring(0, 8) + '... — ' +
|
||||||
|
(confs === 0 ? I18n.t('status_pending') : (confs + '/10'));
|
||||||
|
hint.className = 'qr-hint pending-info';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
app.min.js
vendored
2
app.min.js
vendored
File diff suppressed because one or more lines are too long
10
style.css
10
style.css
@@ -403,6 +403,10 @@ textarea {
|
|||||||
font-family: var(--mono);
|
font-family: var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.payment-summary.paid-confirmed .summary-amount {
|
||||||
|
color: var(--success);
|
||||||
|
}
|
||||||
|
|
||||||
.summary-fiat {
|
.summary-fiat {
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
@@ -617,6 +621,12 @@ textarea {
|
|||||||
font-family: var(--mono);
|
font-family: var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pending-info {
|
||||||
|
color: #f59e0b;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-family: var(--mono);
|
||||||
|
}
|
||||||
|
|
||||||
.btn-new {
|
.btn-new {
|
||||||
margin-top: 0.8rem;
|
margin-top: 0.8rem;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|||||||
Reference in New Issue
Block a user