From 1cee298894de4150dc99c7d9adead91c2d83bce9 Mon Sep 17 00:00:00 2001 From: brantalikp Date: Fri, 3 Oct 2025 11:23:38 +0200 Subject: [PATCH] fix(suite-native): fix QR scan error handling --- .../module-accounts-import/src/useShowImportError.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/suite-native/module-accounts-import/src/useShowImportError.ts b/suite-native/module-accounts-import/src/useShowImportError.ts index 2566c31199..d532df4611 100644 --- a/suite-native/module-accounts-import/src/useShowImportError.ts +++ b/suite-native/module-accounts-import/src/useShowImportError.ts @@ -15,26 +15,31 @@ type AlertErrorOptions = { title: string; description: string; icon?: IconName; + isRetryEnabled: boolean; }; const alertErrorMap: Record = { invalidXpub: { title: 'Invalid Public address (XPUB)', description: 'Check and correct the public address (XPUB).', + isRetryEnabled: false, }, invalidReceiveAddress: { title: 'Receive address invalid', description: 'Check and correct the receive address.', + isRetryEnabled: false, }, networkError: { title: 'Network error', description: 'We were unable to retrieve the data from the blockchain due to a network error.', icon: 'wifiX', + isRetryEnabled: true, }, unknownError: { title: 'Something went wrong', description: 'We are unable to gather the data right now. Please try again.', + isRetryEnabled: true, }, }; @@ -71,9 +76,9 @@ export const useShowImportError = (symbol: NetworkSymbol, navigation: Navigation networkSymbol: symbol, }); - const { title, description, icon } = alertErrorMap[alertError]; + const { title, description, icon, isRetryEnabled } = alertErrorMap[alertError]; - if (onRetry) { + if (onRetry && isRetryEnabled) { showAlert({ title, description,