From 00900bbf50c34217ac36d1fa354d2038e19f1487 Mon Sep 17 00:00:00 2001 From: Tangem Date: Fri, 17 Nov 2023 14:01:17 +0800 Subject: [PATCH] Updated on 2026-08-14 --- .../tangem/tap/common/redux/legacy/LegacyMiddleware.kt | 6 ++++++ .../src/main/java/com/tangem/domain/redux/LegacyAction.kt | 8 ++++++++ .../presentation/wallet/viewmodels/WalletViewModel.kt | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt b/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt index 495a45f59b..81d40b5307 100644 --- a/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/common/redux/legacy/LegacyMiddleware.kt @@ -3,6 +3,7 @@ package com.tangem.tap.common.redux.legacy import com.tangem.domain.redux.LegacyAction import com.tangem.tap.common.feedback.RateCanBeBetterEmail import com.tangem.tap.common.redux.AppState +import com.tangem.tap.common.redux.global.GlobalAction import com.tangem.tap.store import org.rekotlin.Middleware @@ -14,6 +15,11 @@ internal object LegacyMiddleware { is LegacyAction.SendEmailRateCanBeBetter -> { store.state.globalState.feedbackManager?.sendEmail(RateCanBeBetterEmail()) } + is LegacyAction.StartOnboardingProcess -> { + store.dispatch( + GlobalAction.Onboarding.Start(action.scanResponse, canSkipBackup = action.canSkipBackup), + ) + } } next(action) } diff --git a/domain/legacy/src/main/java/com/tangem/domain/redux/LegacyAction.kt b/domain/legacy/src/main/java/com/tangem/domain/redux/LegacyAction.kt index 2565d2f226..f715061ac7 100644 --- a/domain/legacy/src/main/java/com/tangem/domain/redux/LegacyAction.kt +++ b/domain/legacy/src/main/java/com/tangem/domain/redux/LegacyAction.kt @@ -1,8 +1,16 @@ package com.tangem.domain.redux +import com.tangem.domain.models.scan.ScanResponse import org.rekotlin.Action sealed interface LegacyAction : Action { object SendEmailRateCanBeBetter : LegacyAction + + /** + * Initiate an onboarding process. + * For resuming unfinished backup of standard Wallet see + * BackupAction.CheckForUnfinishedBackup, GlobalAction.Onboarding.StartForUnfinishedBackup + */ + data class StartOnboardingProcess(val scanResponse: ScanResponse, val canSkipBackup: Boolean = true) : LegacyAction } \ No newline at end of file diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt index d943c0f76a..bc1c275b2f 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt @@ -431,6 +431,12 @@ internal class WalletViewModel @Inject constructor( override fun onBackupCardClick() { analyticsEventsHandler.send(WalletScreenAnalyticsEvent.MainScreen.NoticeBackupYourWalletTapped) + reduxStateHolder.dispatch( + LegacyAction.StartOnboardingProcess( + scanResponse = getSelectedWallet().scanResponse, + canSkipBackup = false, + ), + ) router.openOnboardingScreen() }