Updated on 2026-08-14

This commit is contained in:
Tangem 2024-08-20 12:03:23 +03:00
commit f15d943267
14 changed files with 50 additions and 37 deletions

BIN
app/libs/rekotlin-1.0.4.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -112,14 +112,14 @@ object OnboardingHelper {
backupCardsIds = backupCardsIds?.toSet(),
),
)
store.dispatchNavigationAction { push(AppRoute.Wallet) }
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
delay(timeMillis = 1_800)
store.dispatchNavigationAction { push(AppRoute.SaveWallet) }
}
// If device has no biometry and save wallet screen has been shown, then go through old scenario
else -> {
proceedWithScanResponse(scanResponse, backupCardsIds, hasBackupError)
store.dispatchNavigationAction { push(AppRoute.Wallet) }
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
}
}
}

View file

@ -4,7 +4,6 @@ import com.tangem.common.*
import com.tangem.common.core.TangemSdkError
import com.tangem.common.extensions.guard
import com.tangem.common.routing.AppRoute
import com.tangem.common.routing.utils.popTo
import com.tangem.core.analytics.Analytics
import com.tangem.domain.wallets.builder.UserWalletBuilder
import com.tangem.domain.wallets.models.UserWallet
@ -12,7 +11,10 @@ import com.tangem.tap.*
import com.tangem.tap.common.analytics.events.AnalyticsParam
import com.tangem.tap.common.analytics.events.MainScreen
import com.tangem.tap.common.analytics.events.Onboarding
import com.tangem.tap.common.extensions.*
import com.tangem.tap.common.extensions.dispatchNavigationAction
import com.tangem.tap.common.extensions.dispatchWithMain
import com.tangem.tap.common.extensions.inject
import com.tangem.tap.common.extensions.onUserWalletSelected
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.proxy.redux.DaggerGraphState
import com.tangem.utils.coroutines.JobHolder
@ -124,7 +126,7 @@ internal class SaveWalletMiddleware {
)
store.dispatchWithMain(SaveWalletAction.AllowToUseBiometrics.Success)
store.dispatchNavigationAction { popTo<AppRoute.Wallet>() }
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
}
private fun dismiss(state: SaveWalletState) {

View file

@ -4,7 +4,6 @@ import arrow.core.Either
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.common.routing.AppRoute
import com.tangem.common.routing.utils.popTo
import com.tangem.data.common.currency.CryptoCurrencyFactory
import com.tangem.domain.card.DerivePublicKeysUseCase
import com.tangem.domain.common.util.derivationStyleProvider
@ -126,7 +125,7 @@ internal class TokensListMigration(
val isNothingToDoWithBlockchain = blockchainsToAdd.isEmpty() && blockchainsToRemove.isEmpty()
if (isNothingToDoWithTokens && isNothingToDoWithBlockchain) {
store.dispatchDebugErrorNotification(message = "Nothing to save")
store.dispatchNavigationAction { popTo<AppRoute.Wallet>() }
navigateToWallet()
return
}
@ -135,11 +134,23 @@ internal class TokensListMigration(
derivePublicKeysUseCase(userWalletId = currentUserWallet.walletId, currencies = currencyList)
.onRight {
addCryptoCurrenciesUseCase(userWalletId = currentUserWallet.walletId, currencies = currencyList)
store.dispatchNavigationAction { popTo<AppRoute.Wallet>() }
navigateToWallet()
}
.onLeft { Timber.e(it, "Failed to derive public keys") }
}
private fun navigateToWallet() {
store.dispatchNavigationAction {
val route = AppRoute.Wallet
if (route in stack) {
popTo(route)
} else {
replaceAll(route)
}
}
}
private suspend fun removeCurrenciesIfNeeded(userWalletId: UserWalletId, currencies: List<CryptoCurrency>) {
if (currencies.isEmpty()) return
val currenciesRepository = store.inject(DaggerGraphState::currenciesRepository)

View file

@ -99,7 +99,7 @@ internal class WelcomeMiddleware {
signInType = Basic.SignedIn.SignInType.Biometric,
)
store.dispatchNavigationAction { push(AppRoute.Wallet) }
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
store.dispatchWithMain(WelcomeAction.ProceedWithBiometrics.Success)
store.onUserWalletSelected(userWallet = selectedUserWallet)
@ -131,7 +131,7 @@ internal class WelcomeMiddleware {
.doOnSuccess {
sendSignedInAnalyticsEvent(scanResponse = scanResponse, signInType = Basic.SignedIn.SignInType.Card)
store.dispatchNavigationAction { push(AppRoute.Wallet) }
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
store.dispatchWithMain(WelcomeAction.ProceedWithCard.Success)
store.onUserWalletSelected(userWallet = userWallet)

View file

@ -2,6 +2,7 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/background_primary">
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -5,7 +5,7 @@
},
{
"name": "LOCAL_USER_LOGS_ENABLED",
"version": "5.13.0"
"version": "undefined"
},
{
"name": "GENERATE_XPUB_ENABLED",

View file

@ -67,5 +67,6 @@ dependencies {
/* Other */
implementation(deps.kotlin.immutable.collections)
implementation(deps.reKotlin)
implementation(deps.timber)
}

View file

@ -5,9 +5,8 @@ import com.tangem.core.decompose.di.ComponentScoped
import com.tangem.core.decompose.model.Model
import com.tangem.core.decompose.model.ParamsContainer
import com.tangem.core.decompose.navigation.Router
import com.tangem.domain.feedback.FeedbackManager
import com.tangem.domain.feedback.GetCardInfoUseCase
import com.tangem.domain.feedback.models.FeedbackEmailType
import com.tangem.domain.redux.LegacyAction
import com.tangem.domain.redux.ReduxStateHolder
import com.tangem.domain.walletconnect.CheckIsWalletConnectAvailableUseCase
import com.tangem.domain.wallets.usecase.GetSelectedWalletSyncUseCase
import com.tangem.features.details.component.DetailsComponent
@ -31,15 +30,14 @@ import javax.inject.Inject
@ComponentScoped
@Suppress("LongParameterList")
internal class DetailsModel @Inject constructor(
private val socialsBuilder: SocialsBuilder,
socialsBuilder: SocialsBuilder,
private val itemsBuilder: ItemsBuilder,
private val appVersionProvider: AppVersionProvider,
private val checkIsWalletConnectAvailableUseCase: CheckIsWalletConnectAvailableUseCase,
private val router: Router,
private val paramsContainer: ParamsContainer,
paramsContainer: ParamsContainer,
private val getSelectedWalletSyncUseCase: GetSelectedWalletSyncUseCase,
private val getCardInfoUseCase: GetCardInfoUseCase,
private val feedbackManager: FeedbackManager,
private val appStateHolder: ReduxStateHolder,
override val dispatchers: CoroutineDispatcherProvider,
) : Model() {
@ -84,18 +82,13 @@ internal class DetailsModel @Inject constructor(
val scanResponse = getSelectedWalletSyncUseCase().getOrNull()?.scanResponse
?: error("Selected wallet is null")
val cardInfo = getCardInfoUseCase(scanResponse = scanResponse).getOrNull()
?: error("CardInfo must be not null")
feedbackManager.sendEmail(type = FeedbackEmailType.DirectUserRequest(cardInfo))
appStateHolder.dispatch(LegacyAction.SendEmailSupport(scanResponse))
}
}
private suspend fun updateState(items: ImmutableList<DetailsItemUM>) {
private fun updateState(items: ImmutableList<DetailsItemUM>) {
state.update { prevState ->
prevState.copy(
items = items,
)
prevState.copy(items = items)
}
}

View file

@ -21,6 +21,7 @@ dependencies {
implementation(projects.core.ui)
implementation(projects.common.routing)
implementation(projects.common.ui)
implementation(projects.core.decompose) // For Route supertype
/** Domain modules **/
implementation(projects.domain.appCurrency)

View file

@ -33,12 +33,18 @@ internal class SwapRouter(
}
fun openTokenDetails(userWalletId: UserWalletId, currency: CryptoCurrency) {
router.push(
AppRoute.CurrencyDetails(
userWalletId = userWalletId,
currency = currency,
),
val route = AppRoute.CurrencyDetails(
userWalletId = userWalletId,
currency = currency,
)
if (route in router.stack) {
router.popTo(route)
} else {
router.pop {
router.push(route)
}
}
}
}

View file

@ -24,6 +24,9 @@ dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
flatDir {
dirs("app/libs")
}
google {
content {
includeGroupAndSubgroups("androidx")
@ -92,11 +95,6 @@ dependencyResolutionManagement {
includeGroupAndSubgroups("com.tangem.vico")
}
}
jcenter { // unable to replace with mavenCentral() due to rekotlin
content {
includeModule("org.rekotlin", "rekotlin")
}
}
maven("https://jitpack.io")
maven("https://clients-nexus.sprinklr.com/")
}