Updated on 2026-08-14
This commit is contained in:
parent
737bb507d9
commit
f9d1e222af
2 changed files with 8 additions and 8 deletions
|
|
@ -27,6 +27,7 @@ import com.tangem.domain.yield.supply.models.YieldMarketToken
|
|||
import com.tangem.domain.yield.supply.models.YieldSupplyEnterStatus
|
||||
import com.tangem.domain.yield.supply.models.YieldSupplyMarketChartData
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import com.tangem.utils.coroutines.runSuspendCatching
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.withContext
|
||||
|
|
@ -155,7 +156,7 @@ internal class DefaultYieldSupplyRepository(
|
|||
override suspend fun getTokenPendingStatus(
|
||||
userWalletId: UserWalletId,
|
||||
cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
): YieldSupplyEnterStatus? = try {
|
||||
): YieldSupplyEnterStatus? = runSuspendCatching {
|
||||
val cryptoCurrency = cryptoCurrencyStatus.currency
|
||||
val walletManager = walletManagersFacade.getOrCreateWalletManager(
|
||||
userWalletId = userWalletId,
|
||||
|
|
@ -174,10 +175,9 @@ internal class DefaultYieldSupplyRepository(
|
|||
hasRecentYieldExitTxs -> YieldSupplyEnterStatus.Exit
|
||||
else -> null
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Failed to get pending yield supply status")
|
||||
null
|
||||
}
|
||||
}.onFailure { exception ->
|
||||
Timber.w(exception, "Failed to get pending yield supply status")
|
||||
}.getOrNull()
|
||||
|
||||
override fun getShouldShowYieldPromoBanner(): Flow<Boolean> {
|
||||
return appPreferencesStore.get(PreferencesKeys.YIELD_SUPPLY_SHOULD_SHOW_MAIN_PROMO_KEY, true)
|
||||
|
|
|
|||
|
|
@ -176,14 +176,14 @@ private fun ColumnScope.Content(state: MarketsListUM, modifier: Modifier = Modif
|
|||
)
|
||||
}
|
||||
|
||||
val marketsNotificationUM = state.marketsNotificationUM
|
||||
AnimatedVisibility(
|
||||
state.list !is ListUM.LoadingError &&
|
||||
state.isInSearchMode.not() && state.selectedSortBy != SortByTypeUM.YieldSupply,
|
||||
) {
|
||||
val wrappedNotification = remember(this) { state.marketsNotificationUM }
|
||||
val showMore = stringResourceSafe(R.string.common_show_more)
|
||||
|
||||
when (wrappedNotification) {
|
||||
when (marketsNotificationUM) {
|
||||
is MarketsNotificationUM.YieldSupplyPromo -> {
|
||||
val description = stringResourceSafe(
|
||||
R.string.markets_yield_supply_banner_description,
|
||||
|
|
@ -199,7 +199,7 @@ private fun ColumnScope.Content(state: MarketsListUM, modifier: Modifier = Modif
|
|||
}
|
||||
|
||||
YieldSupplyInMarketsPromoNotification(
|
||||
config = wrappedNotification.config.copy(
|
||||
config = marketsNotificationUM.config.copy(
|
||||
subtitle = clickableDescription,
|
||||
),
|
||||
modifier = Modifier.padding(bottom = TangemTheme.dimens.spacing12),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue