Fix paid/pending invoice status UI and date handling

This commit is contained in:
Alexander Schmidt
2026-03-26 10:06:08 +01:00
parent dc330d2367
commit d2684c3638
3 changed files with 23 additions and 5 deletions

16
app.js
View File

@@ -458,6 +458,7 @@
html += '<div class="summary-desc">' + desc.replace(/</g, '&lt;') + '</div>';
}
paymentSummary.innerHTML = html;
paymentSummary.classList.remove('paid-confirmed');
}
function updatePageTitle(xmrAmount, desc) {
@@ -938,6 +939,10 @@
}
function showPaidStatus(data) {
if (!data.verified_at) {
data = Object.assign({}, data, { verified_at: Math.floor(Date.now() / 1000) });
}
paymentStatus.className = 'payment-status paid';
// Stamp over QR + dim QR
@@ -962,13 +967,13 @@
year: 'numeric', month: 'long', day: 'numeric'
});
}
hint.textContent = data.amount.toFixed(6) + ' XMR — TX ' +
data.tx_hash.substring(0, 8) + '...' + dateStr;
hint.textContent = 'TX ' + data.tx_hash.substring(0, 8) + '...' + dateStr;
hint.className = 'qr-hint paid-info';
}
paymentStatus.innerHTML = '';
lastPaidData = data;
paymentSummary.classList.add('paid-confirmed');
// Hide unnecessary buttons when paid
openWalletBtn.style.display = 'none';
@@ -981,6 +986,7 @@
function showPendingStatus(data) {
var confs = data.confirmations || 0;
paymentStatus.className = 'payment-status pending';
paymentSummary.classList.remove('paid-confirmed');
qrContainer.classList.add('confirming');
var existingStamp = qrContainer.querySelector('.paid-stamp');
@@ -993,8 +999,10 @@
existingStamp.textContent = confs === 0 ? I18n.t('status_pending') : (confs + '/10');
var hint = qrContainer.querySelector('.qr-hint');
if (hint && !hint.classList.contains('paid-info')) {
hint.textContent = data.amount.toFixed(6) + ' XMR — TX ' + data.tx_hash.substring(0, 8) + '...';
if (hint) {
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

File diff suppressed because one or more lines are too long

View File

@@ -403,6 +403,10 @@ textarea {
font-family: var(--mono);
}
.payment-summary.paid-confirmed .summary-amount {
color: var(--success);
}
.summary-fiat {
font-size: 0.85rem;
color: var(--text-muted);
@@ -617,6 +621,12 @@ textarea {
font-family: var(--mono);
}
.pending-info {
color: #f59e0b;
font-size: 0.75rem;
font-family: var(--mono);
}
.btn-new {
margin-top: 0.8rem;
background: transparent;