From ef8b651f2814754d5780ca08472bd88921f989f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Wed, 16 Sep 2026 08:44:44 +0300 Subject: [PATCH] scp80: keep the card preset selected after a send (v2.1.18) cardsSave() calls cardsRebuildSelect(), and the innerHTML rebuild reset the dropdown to its first option ("- Select card -"). Since the counter sync saves after every send, the selection was lost each time and had to be re-picked manually. The rebuild now restores the previous selection (guarded by the preset still existing). Service worker v155. --- frontend/index.html | 7 ++++++- frontend/sw.js | 2 +- pyproject.toml | 2 +- pysim_otaman_server/server.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 111d9d3..491d7d7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -18,7 +18,7 @@
-

OTAMan SIM OTA with a Human Face v2.1.17

+

OTAMan SIM OTA with a Human Face v2.1.18

@@ -5789,11 +5789,16 @@ function cardsRender() { function cardsRebuildSelect() { const sel = document.getElementById('sp-card-sel'); if (!sel) return; + // Keep the current selection: cardsSave() runs after every send (counter + // sync) and an innerHTML rebuild otherwise resets the dropdown to its + // first option, forcing a manual re-select each time (fixed 2.1.18). + const prev = sel.value; let html = ''; for (let i = 0; i < cards.length; i++) { html += ''; } sel.innerHTML = html; + if (prev !== '' && cards[parseInt(prev, 10)]) sel.value = prev; } function cardsApply(idx) { diff --git a/frontend/sw.js b/frontend/sw.js index 71cdbc5..cd9092e 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'otaman-v154'; +const CACHE = 'otaman-v155'; const URLS = [ 'index.html', 'help.html', diff --git a/pyproject.toml b/pyproject.toml index e9abd68..302f674 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pysim-otaman-server" -version = "2.1.17" +version = "2.1.18" description = "HTTP REST server wrapping pysim for the OTAMan PWA" requires-python = ">=3.8" # pysim is a git-only dependency installed explicitly by setup.bat/setup.sh. diff --git a/pysim_otaman_server/server.py b/pysim_otaman_server/server.py index f4e80a3..2e8ab69 100644 --- a/pysim_otaman_server/server.py +++ b/pysim_otaman_server/server.py @@ -21,7 +21,7 @@ from osmocom.construct import GsmOrUcs2Adapter from osmocom.tlv import BER_TLV_IE -VERSION = '2.1.17' +VERSION = '2.1.18' MAX_ENVELOPE_SEGMENTS = 5 # max SMS segments for outgoing C-APDU in ENVELOPE