From c8bc53eb43a57d7fe42259df95d11c4664e34980 Mon Sep 17 00:00:00 2001 From: ai-bot Date: Sun, 15 Nov 2026 11:23:55 +0000 Subject: [PATCH] Show the unit of a fixed currency and open a choice on its default --- static/transaction.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/static/transaction.js b/static/transaction.js index 04c3912..e0f411c 100644 --- a/static/transaction.js +++ b/static/transaction.js @@ -318,12 +318,19 @@ return; } label(name).textContent = settings.label; + var choice = settings.currencies.length > 1; var currencySelect = document.querySelector('[name="' + name + '_currency"]'); - var fixed = settings.currencies.length === 1; - currencySelect.hidden = fixed; - currencySelect.value = settings.currencies[0]; + currencySelect.hidden = !choice; + currencySelect.value = settings.default || settings.currencies[0]; + var unitSlot = unit(name); + unitSlot.hidden = choice; + unitSlot.textContent = UNIT_LABELS[settings.currencies[0]]; }); + // The price is always in kroner and a fee always in sats (section 7.3). + unit("value").textContent = UNIT_LABELS.nok; + unit("fee").textContent = UNIT_LABELS.sats; + group("value").hidden = !spec.value; if (spec.value) { label("value").textContent = spec.value.label;