Show the unit of a fixed currency and open a choice on its default

This commit is contained in:
ai-bot committed 2026-11-15 11:23:55 +00:00
1 parent 8f345127e8
commit c8bc53eb43
1 file changed
+10 -3
+10 -3
View File
@@ -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;