Keep short URL in share field when loaded via short link

This commit is contained in:
Alexander Schmidt
2026-03-26 13:40:16 +01:00
parent 3dd1e55432
commit 69f173bc2f
2 changed files with 10 additions and 6 deletions

6
app.js
View File

@@ -320,12 +320,16 @@
buildSummary(xmrAmount, desc, timer); buildSummary(xmrAmount, desc, timer);
updatePageTitle(xmrAmount, desc); updatePageTitle(xmrAmount, desc);
// Share link — show long URL immediately, then replace with short // Share link — keep existing short URL if present; otherwise shorten new hash
const hash = buildHash(addr, xmrAmount, desc, timer); const hash = buildHash(addr, xmrAmount, desc, timer);
if (invoiceCode) {
shareLinkInput.value = location.origin + '/s/' + invoiceCode;
} else {
shareLinkInput.value = location.origin + '/#' + hash; shareLinkInput.value = location.origin + '/#' + hash;
shortenUrl(hash).then(function (shortUrl) { shortenUrl(hash).then(function (shortUrl) {
if (shortUrl) shareLinkInput.value = shortUrl; if (shortUrl) shareLinkInput.value = shortUrl;
}); });
}
// QR // QR
qrContainer.innerHTML = ''; qrContainer.innerHTML = '';

2
app.min.js vendored

File diff suppressed because one or more lines are too long