parent
bf26eb7b78
commit
79a2e87c2a
|
@ -6,6 +6,9 @@ and this application adheres to [Semantic Versioning](https://semver.org/spec/v2
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- The Security Warning screen has been removed from onboarding of the FOSS app build type
|
||||
|
||||
## [1.5.2 (926)] - 2025-04-03
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -15,6 +15,7 @@ import co.electriccoin.zcash.spackle.FirebaseTestLabUtil
|
|||
import co.electriccoin.zcash.ui.common.compose.LocalActivity
|
||||
import co.electriccoin.zcash.ui.common.model.OnboardingState
|
||||
import co.electriccoin.zcash.ui.common.model.VersionInfo
|
||||
import co.electriccoin.zcash.ui.common.model.WalletRestoringState
|
||||
import co.electriccoin.zcash.ui.common.viewmodel.WalletViewModel
|
||||
import co.electriccoin.zcash.ui.screen.onboarding.view.Onboarding
|
||||
import co.electriccoin.zcash.ui.screen.onboarding.viewmodel.OnboardingViewModel
|
||||
|
@ -34,7 +35,14 @@ internal fun WrapOnboarding() {
|
|||
|
||||
if (!onboardingViewModel.isImporting.collectAsStateWithLifecycle().value) {
|
||||
val onCreateWallet = {
|
||||
walletViewModel.persistOnboardingState(OnboardingState.NEEDS_WARN)
|
||||
walletViewModel.persistOnboardingState(
|
||||
if (onboardingViewModel.isSecurityScreenAllowed) {
|
||||
OnboardingState.NEEDS_WARN
|
||||
} else {
|
||||
walletViewModel.persistNewWalletAndRestoringState(WalletRestoringState.INITIATING)
|
||||
OnboardingState.NEEDS_BACKUP
|
||||
}
|
||||
)
|
||||
}
|
||||
val onImportWallet = {
|
||||
// In the case of the app currently being messed with by the robo test runner on
|
||||
|
|
|
@ -3,6 +3,8 @@ package co.electriccoin.zcash.ui.screen.onboarding.viewmodel
|
|||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import co.electriccoin.zcash.ui.common.model.DistributionDimension
|
||||
import co.electriccoin.zcash.ui.common.provider.GetVersionInfoProvider
|
||||
|
||||
/*
|
||||
* Android-specific ViewModel. This is used to save and restore state across Activity recreations
|
||||
|
@ -10,13 +12,16 @@ import androidx.lifecycle.SavedStateHandle
|
|||
*/
|
||||
class OnboardingViewModel(
|
||||
application: Application,
|
||||
private val savedStateHandle: SavedStateHandle
|
||||
private val savedStateHandle: SavedStateHandle,
|
||||
getVersionInfo: GetVersionInfoProvider,
|
||||
) : AndroidViewModel(application) {
|
||||
// This is a bit weird being placed here, but onboarding currently is considered complete when
|
||||
// the user has a persisted wallet. Also import allows the user to go back to onboarding, while
|
||||
// creating a new wallet does not.
|
||||
val isImporting = savedStateHandle.getStateFlow(KEY_IS_IMPORTING, false)
|
||||
|
||||
val isSecurityScreenAllowed = getVersionInfo().distributionDimension == DistributionDimension.STORE
|
||||
|
||||
fun setIsImporting(isImporting: Boolean) {
|
||||
savedStateHandle[KEY_IS_IMPORTING] = isImporting
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue