From e202ab986b3333f0655eaf25503f257ce0e40c80 Mon Sep 17 00:00:00 2001 From: scgbckbone Date: Tue, 24 Jun 2025 19:09:13 +0200 Subject: [PATCH] decouple wiping NFC chip from `ux_animation` routine --- shared/nfc.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/shared/nfc.py b/shared/nfc.py index d84a83df..29c5ee7c 100644 --- a/shared/nfc.py +++ b/shared/nfc.py @@ -227,7 +227,9 @@ class NFCHandler: async def share_loop(self, n, **kws): while 1: done = await self.share_start(n, **kws) - if done: break + if done: + # do not wipe if we are not done + await self.wipe(kws.get("is_secret", False)) async def share_signed_txn(self, txid, file_offset, txn_len, txn_sha): # we just signed something, share it over NFC @@ -471,10 +473,6 @@ class NFCHandler: break self.set_rf_disable(1) - # do not wipe if we are not aborted - if not write_mode and aborted: - # function argument secret decides whether to do full wipe after writing to chip - await self.wipe(is_secret) return aborted @@ -482,9 +480,7 @@ class NFCHandler: # do the UX while we are sharing a value over NFC # - assumpting is people know what they are scanning # - x key to abort early, but also self-clears - await self.big_write(ndef_obj.bytes()) - return await self.ux_animation(False, **kws) async def start_nfc_rx(self, **kws):