Skip to content

Commit

Permalink
Merge pull request #358 from Foundation-Devices/SFT-2453-warning-icon…
Browse files Browse the repository at this point in the history
…-cut

SFT-2453: warning icon cut
  • Loading branch information
mjg-foundation authored Jul 19, 2023
2 parents 725fe93 + d968bcd commit 838ab76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ports/stm32/boards/Passport/modules/flows/scan_qr_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from data_codecs.qr_type import QRType
from flows import Flow
from pages import ScanQRPage, ErrorPage
from pages import ScanQRPage, LongErrorPage
from foundation import ur


Expand All @@ -16,7 +16,8 @@ def __init__(self,
ur_types=None,
explicit_type=None,
data_description=None,
max_frames=None):
max_frames=None,
failure_message=None):
"""
Initialize the scan QR flow.
Expand All @@ -40,6 +41,7 @@ def __init__(self,
self.data_description = data_description
self.data = None
self.max_frames = max_frames
self.failure_message = failure_message or 'Unable to scan QR code.\n\n{}'

if len(self.qr_types) == 0:
raise ValueError('At least one QR type must be provided')
Expand All @@ -62,7 +64,7 @@ async def scan(self):
return

if result.is_failure():
await ErrorPage(text='Unable to scan QR code.\n\n{}'.format(result.error)).show()
await LongErrorPage(text=self.failure_message.format(result.error)).show()
self.set_result(None)
return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ async def scan_transaction(self):
result = await ScanQRFlow(qr_types=[QRType.QR, QRType.UR2],
ur_types=[ur.Value.CRYPTO_PSBT, ur.Value.BYTES],
data_description='a PSBT file',
max_frames=self.max_frames).run()
max_frames=self.max_frames,
failure_message="Unable to Scan QR code, \
try signing using the microSD card.\n\n{}").run()
if result is None:
# User canceled the scan
self.set_result(False)
Expand Down

0 comments on commit 838ab76

Please sign in to comment.