diff --git a/app/index.html b/app/index.html index f9fc83d..3abcfec 100644 --- a/app/index.html +++ b/app/index.html @@ -555,7 +555,7 @@ function buildForm() {
${t("charge-to")}: - ${ctOpts} @@ -1049,6 +1049,17 @@ function restoreStorage() { if (el) el.value = v; }); + // Restore charge-to: rebuild its project code options then re-apply pcode. + // fillChargeTo() calls updateProjectCodes() which resets the pcode select, + // and may call saveStorage() mid-flow, so we re-apply and re-save after. + const ctPickEl = document.getElementById("ct-pick"); + if (ctPickEl?.value) { + fillChargeTo(ctPickEl.value); + const pcodeEl = document.getElementById("pcode"); + if (pcodeEl && d.pcode) pcodeEl.value = d.pcode; + saveStorage(); + } + // Restore "Other" project-code visibility if (d.pcode === "__other__") { const w = document.getElementById("pcode-other-wrap");