From 7235697405d22233be3216d3651b13cffa3994db Mon Sep 17 00:00:00 2001 From: ai-bot Date: Mon, 16 Nov 2026 19:02:31 +0000 Subject: [PATCH] Refresh only the currency dependent parts on a currency change --- static/transaction.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/transaction.js b/static/transaction.js index f426bf8..11c8600 100644 --- a/static/transaction.js +++ b/static/transaction.js @@ -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() { var spec = currentType(); [["leg_in", spec.in], ["leg_out", spec.out]].forEach(function (pair) {