From 5675c1fe813d008c3978148cbbcc60203b65cf38 Mon Sep 17 00:00:00 2001 From: ice-orion <102020833+ice-orion@users.noreply.github.com> Date: Thu, 1 Feb 2024 13:48:43 +0400 Subject: [PATCH] fix: sentry issues (#266) * fix crash after onboarding if user doesn't grant notification permissions on the last step * fix "address not EOA" error handling --- .../WelcomeFlow/Onboarding/hooks/useFinishOnboarding.ts | 6 ++++++ src/store/modules/Account/sagas/updateAccount.ts | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/screens/WelcomeFlow/Onboarding/hooks/useFinishOnboarding.ts b/src/screens/WelcomeFlow/Onboarding/hooks/useFinishOnboarding.ts index 1efd78668..6dab64c0b 100644 --- a/src/screens/WelcomeFlow/Onboarding/hooks/useFinishOnboarding.ts +++ b/src/screens/WelcomeFlow/Onboarding/hooks/useFinishOnboarding.ts @@ -34,8 +34,14 @@ export const useFinishOnboarding = () => { useNavigation>(); const user = useSelector(unsafeUserSelector); + /** + * Do not subscribe to `canAskPermissionSelector('pushNotifications')` + * because otherwise the number of slides is changed + * when user grants / denies permissions on the "notifications" slide. + */ const canAskNotificationPermission = useSelector( canAskPermissionSelector('pushNotifications'), + () => true, ); const loading = useSelector( diff --git a/src/store/modules/Account/sagas/updateAccount.ts b/src/store/modules/Account/sagas/updateAccount.ts index af3b82697..1c671cb39 100644 --- a/src/store/modules/Account/sagas/updateAccount.ts +++ b/src/store/modules/Account/sagas/updateAccount.ts @@ -153,6 +153,10 @@ function* validateMiningBlockchainAccountAddress( throw new ValidationError(ValidationErrorCode.BscAddressIsNotEoa); } } catch (error) { + if (isValidationError(error)) { + throw error; + } + const typedError = error as EoaBscAddressError; const networkErrorTypes: typeof typedError['name'][] = [ 'HttpRequestError',