fix(web): reveal NFC peripherals after detection

This commit is contained in:
Miayui
2026-09-21 11:04:18 +08:00
parent 448c8b31a0
commit b3bd90f748
9 changed files with 75 additions and 14 deletions
@@ -167,6 +167,7 @@ class NfcExtensionToyPublisher:
"active_catalog_revision": None,
"active_extension_names": [],
"active_target_scopes": [],
"detected_nfc_ids": [],
"message_count": 0,
"burst_frame_attempt_count": 0,
"burst_publish_attempt_count": 0,
@@ -192,6 +193,7 @@ class NfcExtensionToyPublisher:
active_catalog_revision=None,
active_extension_names=[],
active_target_scopes=[],
detected_nfc_ids=[],
message_count=0,
last_error=None,
)
@@ -214,6 +216,7 @@ class NfcExtensionToyPublisher:
active_catalog_revision=None,
active_extension_names=[],
active_target_scopes=[],
detected_nfc_ids=[],
message_count=0,
)
@@ -346,6 +349,14 @@ class NfcExtensionToyPublisher:
self._stop.wait(self.poll_interval_s)
continue
if card_uid:
with self._lock:
detected_nfc_ids = list(self._status["detected_nfc_ids"])
if card_uid not in detected_nfc_ids:
self._set_status(
detected_nfc_ids=[*detected_nfc_ids, card_uid],
)
try:
catalog_revision = self._catalog_revision() if card_uid else ""
except Exception as exc: # noqa: BLE001 - retry while the card remains