Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFT-2453: warning icon cut #358

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading