Ask for a destination only when sats are sent

This commit is contained in:
ai-bot committed 2026-11-15 18:31:41 +00:00
1 parent 4d1dbb8c49
commit 3070d57868
1 file changed
+9
+9
View File
@@ -345,6 +345,15 @@
if (!spec.to) { if (!spec.to) {
Skuld.setFieldValue("to_market", ""); Skuld.setFieldValue("to_market", "");
} }
// An empty destination is a withdrawal, and only kroner can be withdrawn
// (docs/spec.md section 3.11).
var destination = document.querySelector('[name="to_market"]');
var kroner = Skuld.fieldValue("leg_out_currency") === "nok";
destination.required = Boolean(spec.to) && !kroner;
var destinationHint = document.querySelector("[data-destination-hint]");
if (destinationHint) {
destinationHint.hidden = !spec.to || !kroner;
}
group("market").hidden = !spec.market; group("market").hidden = !spec.market;
var marketSelect = document.querySelector('[name="market_id"]'); var marketSelect = document.querySelector('[name="market_id"]');