Updated on 2026-08-14
This commit is contained in:
commit
72dfa81fcf
4 changed files with 23 additions and 10 deletions
|
|
@ -1,6 +1,5 @@
|
|||
package com.tangem.tap
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.core.os.bundleOf
|
||||
|
|
@ -21,15 +20,11 @@ internal class DecomposeFragment : ComposeFragment() {
|
|||
@Inject
|
||||
override lateinit var uiDependencies: UiDependencies
|
||||
|
||||
private lateinit var component: ComposableContentComponent
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
private val component by lazy(LazyThreadSafetyMode.NONE) {
|
||||
val tag = requireArguments().getString(TAG_KEY)
|
||||
val builder = componentsBuilders[tag]
|
||||
|
||||
component = requireNotNull(builder?.build()) {
|
||||
requireNotNull(builder?.build()) {
|
||||
"Component builder is not set, call newInstance() for DecomposeFragment creation first."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import androidx.compose.ui.graphics.toArgb
|
|||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.fragment.app.FragmentManager.POP_BACK_STACK_INCLUSIVE
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.flowWithLifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
|
@ -330,6 +331,19 @@ class MainActivity : AppCompatActivity(), SnackbarHandler, ActivityResultCallbac
|
|||
|
||||
appRouterConfig.stack = stack
|
||||
|
||||
if (stack.size == 1) {
|
||||
supportFragmentManager.run {
|
||||
val activeChildName = stack.first().path
|
||||
|
||||
(0 until backStackEntryCount)
|
||||
.mapNotNull { getBackStackEntryAt(it).name }
|
||||
.filter { it != activeChildName }
|
||||
.forEach {
|
||||
popBackStackImmediate(it, POP_BACK_STACK_INCLUSIVE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when (val child = childStack.active.instance) {
|
||||
is RoutingComponent.Child.Initial -> Unit
|
||||
is RoutingComponent.Child.LegacyFragment -> {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ internal class HomeModel @Inject constructor(
|
|||
store.dispatchWithMain(HomeAction.ScanInProgress(scanInProgress = false))
|
||||
delay(HIDE_PROGRESS_DELAY)
|
||||
|
||||
store.dispatchNavigationAction { push(AppRoute.Wallet) }
|
||||
store.dispatchNavigationAction { replaceAll(AppRoute.Wallet) }
|
||||
}
|
||||
|
||||
private fun sendSignedInCardAnalyticsEvent(scanResponse: ScanResponse) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tangem.core.analytics.models.AnalyticsParam
|
|||
import com.tangem.core.decompose.di.ModelScoped
|
||||
import com.tangem.domain.analytics.CheckIsWalletToppedUpUseCase
|
||||
import com.tangem.domain.analytics.model.WalletBalanceState
|
||||
import com.tangem.domain.models.StatusSource
|
||||
import com.tangem.domain.tokens.model.CryptoCurrencyStatus
|
||||
import com.tangem.domain.tokens.model.TokenList
|
||||
import com.tangem.domain.tokens.model.TotalFiatBalance
|
||||
|
|
@ -74,7 +75,8 @@ internal class TokenListAnalyticsSender @Inject constructor(
|
|||
when (totalFiatBalance) {
|
||||
is TotalFiatBalance.Loaded -> putAttribute(HAS_ERROR, "No")
|
||||
is TotalFiatBalance.Failed -> putAttribute(HAS_ERROR, "Yes")
|
||||
else -> { /* Intentionally do nothing */ }
|
||||
else -> { /* Intentionally do nothing */
|
||||
}
|
||||
}
|
||||
stop()
|
||||
loadingTraces.remove(userWalletId)
|
||||
|
|
@ -83,7 +85,9 @@ internal class TokenListAnalyticsSender @Inject constructor(
|
|||
}
|
||||
|
||||
private fun isTerminalState(balance: TotalFiatBalance): Boolean {
|
||||
return balance is TotalFiatBalance.Failed || balance is TotalFiatBalance.Loaded
|
||||
val isLoaded = balance is TotalFiatBalance.Loaded &&
|
||||
(balance.source == StatusSource.ACTUAL || balance.source == StatusSource.ONLY_CACHE)
|
||||
return balance is TotalFiatBalance.Failed || isLoaded
|
||||
}
|
||||
|
||||
private fun sendBalanceLoadedEventIfNeeded(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue