Refresh only the currency dependent parts on a currency change

This commit is contained in:
ai-bot committed 2026-11-16 19:02:31 +00:00
1 parent 29657b6e15
commit 7235697405
1 file changed
+12
+12
View File
@@ -310,6 +310,18 @@
}); });
} }
/* What depends on the currency of the outgoing leg (docs/spec.md section 3.11). */
function syncDestination() {
var spec = currentType();
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;
}
}
function applyType() { function applyType() {
var spec = currentType(); var spec = currentType();
[["leg_in", spec.in], ["leg_out", spec.out]].forEach(function (pair) { [["leg_in", spec.in], ["leg_out", spec.out]].forEach(function (pair) {