From 579a28613c3f88bb6cddfbdcd52dc59144ece332 Mon Sep 17 00:00:00 2001 From: kabramovp2p <99185280+kabramovp2p@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:29:25 +0300 Subject: [PATCH] PWN-9040 - phone number reset on block screen (#1877) --- .../org/p2p/wallet/settings/ui/devices/DevicesPresenter.kt | 3 ++- .../smsinput/updatedevice/UpdateDeviceSmsInputPresenter.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/p2p/wallet/settings/ui/devices/DevicesPresenter.kt b/app/src/main/java/org/p2p/wallet/settings/ui/devices/DevicesPresenter.kt index 871cc10266..980b8af53a 100644 --- a/app/src/main/java/org/p2p/wallet/settings/ui/devices/DevicesPresenter.kt +++ b/app/src/main/java/org/p2p/wallet/settings/ui/devices/DevicesPresenter.kt @@ -103,6 +103,7 @@ class DevicesPresenter( if (restoreWalletInteractor.getUserEnterPhoneNumberTriesCount() >= MAX_PHONE_NUMBER_TRIES) { restoreWalletInteractor.resetUserEnterPhoneNumberTriesCount() view?.navigateToAccountBlocked(DEFAULT_BLOCK_TIME_IN_MINUTES.minutes.inWholeSeconds) + restoreWalletInteractor.resetUserPhoneNumber() } else { restoreWalletInteractor.startRestoreCustomShare(userPhoneNumber = phoneNumber) view?.navigateToSmsInput() @@ -119,13 +120,13 @@ class DevicesPresenter( } private fun handleGatewayServiceError(gatewayServiceError: PushServiceError) { - // TODO PWN-8827 fix error handling! when (val gatewayHandledResult = gatewayServiceErrorHandler.handle(gatewayServiceError)) { is GatewayHandledState.CriticalError -> { view?.showUiKitSnackBar(gatewayHandledResult.errorCode.toString()) } is GatewayHandledState.TimerBlockError -> { view?.navigateToAccountBlocked(gatewayHandledResult.cooldownTtl) + restoreWalletInteractor.resetUserPhoneNumber() } is GatewayHandledState.TitleSubtitleError -> { view?.showUiKitSnackBar(gatewayHandledResult.title) diff --git a/app/src/main/java/org/p2p/wallet/smsinput/updatedevice/UpdateDeviceSmsInputPresenter.kt b/app/src/main/java/org/p2p/wallet/smsinput/updatedevice/UpdateDeviceSmsInputPresenter.kt index f287fba8f0..163d81d07f 100644 --- a/app/src/main/java/org/p2p/wallet/smsinput/updatedevice/UpdateDeviceSmsInputPresenter.kt +++ b/app/src/main/java/org/p2p/wallet/smsinput/updatedevice/UpdateDeviceSmsInputPresenter.kt @@ -76,6 +76,7 @@ class UpdateDeviceSmsInputPresenter( } is GatewayHandledState.TimerBlockError -> { view?.navigateToSmsInputBlocked(gatewayHandledResult.error, gatewayHandledResult.cooldownTtl) + restoreWalletInteractor.resetUserPhoneNumber() } is GatewayHandledState.TitleSubtitleError -> { view?.navigateToGatewayErrorScreen(gatewayHandledResult)