You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitself.show(QRAlert(title="Your mnemonic as QR code", message=msg, qr_message=qr_msg, transcribe=True))
397
397
elifv==ExportMnemonicScreen.SD:
398
-
ifnotplatform.is_sd_present:
398
+
ifnotplatform.sdcard.is_present:
399
399
raiseKeyStoreError("SD card is not present")
400
400
ifawaitself.show(Prompt("Are you sure?", message="Your mnemonic will be saved as a simple plaintext file.\n\nAnyone with access to it will be able to read your key.\n\nContinue?")):
401
-
platform.mount_sdcard()
402
-
fname="/sd/%s.txt"%self.mnemonic.split()[0]
403
-
withopen(platform.fpath(fname), "w") asf:
404
-
f.write(self.mnemonic)
405
-
platform.unmount_sdcard()
401
+
withplatform.sdcardassd:
402
+
fname="%s.txt"%self.mnemonic.split()[0]
403
+
ifsd.file_exists(fname):
404
+
confirm=awaitself.show(Prompt("Overwrite?", message="File %s already exists on the SD card. Overwrite?"%fname))
405
+
ifnotconfirm:
406
+
return
407
+
withsd.open(fname, "w") asf:
408
+
f.write(self.mnemonic)
406
409
awaitself.show(Alert(title="Mnemonic is saved!", message="You mnemonic is saved in plaintext to\n\n%s\n\nPlease keep it safe."%fname))
0 commit comments