Updated on 2026-08-14
This commit is contained in:
commit
bd61160ebb
8 changed files with 39 additions and 23 deletions
|
|
@ -14,6 +14,7 @@ import com.tangem.wallet.R
|
|||
|
||||
class CustomTabsManager {
|
||||
fun openUrl(url: String, context: Context) {
|
||||
if (url.isEmpty()) return
|
||||
val customTabsIntent = CustomTabsIntent.Builder()
|
||||
.setDefaultColorSchemeParams(
|
||||
CustomTabColorSchemeParams.Builder()
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import androidx.compose.runtime.MutableState
|
|||
import androidx.compose.runtime.mutableStateOf
|
||||
import com.tangem.common.extensions.guard
|
||||
import com.tangem.core.analytics.Analytics
|
||||
import com.tangem.core.analytics.models.Basic
|
||||
import com.tangem.core.navigation.AppScreen
|
||||
import com.tangem.core.navigation.NavigationAction
|
||||
import com.tangem.core.ui.event.StateEvent
|
||||
|
|
@ -137,7 +138,7 @@ internal class DetailsViewModel(
|
|||
}
|
||||
|
||||
private fun sendFeedback() {
|
||||
Analytics.send(Settings.ButtonSendFeedback())
|
||||
Analytics.send(Basic.ButtonSupport())
|
||||
store.dispatchOnMain(GlobalAction.SendEmail(FeedbackEmail()))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package com.tangem.domain.txhistory.models
|
||||
|
||||
sealed class TxStatusError {
|
||||
|
||||
data object EmptyUrlError : TxStatusError()
|
||||
data class DataError(val cause: Throwable) : TxStatusError()
|
||||
}
|
||||
|
|
@ -1,12 +1,25 @@
|
|||
package com.tangem.domain.txhistory.usecase
|
||||
|
||||
import arrow.core.Either
|
||||
import arrow.core.raise.catch
|
||||
import arrow.core.raise.either
|
||||
import com.tangem.domain.tokens.model.Network
|
||||
import com.tangem.domain.txhistory.models.TxStatusError
|
||||
import com.tangem.domain.txhistory.repository.TxHistoryRepository
|
||||
|
||||
class GetExplorerTransactionUrlUseCase(
|
||||
private val repository: TxHistoryRepository,
|
||||
) {
|
||||
operator fun invoke(txHash: String, networkId: Network.ID): String {
|
||||
return repository.getTxExploreUrl(txHash, networkId)
|
||||
operator fun invoke(txHash: String, networkId: Network.ID): Either<TxStatusError, String> {
|
||||
return either {
|
||||
catch(
|
||||
block = {
|
||||
repository.getTxExploreUrl(txHash, networkId).ifEmpty {
|
||||
raise(TxStatusError.EmptyUrlError)
|
||||
}
|
||||
},
|
||||
catch = { raise(TxStatusError.DataError(it)) },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -233,7 +233,7 @@ internal class SendStateFactory(
|
|||
val txUrl = getExplorerTransactionUrlUseCase(
|
||||
txHash = txData.hash.orEmpty(),
|
||||
networkId = cryptoCurrency.network.id,
|
||||
)
|
||||
).getOrElse { "" }
|
||||
return state.copy(
|
||||
sendState = state.sendState.copy(
|
||||
transactionDate = txData.date?.timeInMillis ?: System.currentTimeMillis(),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import androidx.compose.runtime.setValue
|
|||
import androidx.lifecycle.*
|
||||
import androidx.paging.cachedIn
|
||||
import arrow.core.getOrElse
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchain.common.address.AddressType
|
||||
import com.tangem.core.analytics.api.AnalyticsEventHandler
|
||||
import com.tangem.core.deeplink.DeepLinksRegistry
|
||||
|
|
@ -600,20 +599,13 @@ internal class TokenDetailsViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onTransactionClick(txHash: String) {
|
||||
// TODO: Fix tx urls [REDACTED_TASK_KEY]
|
||||
when (Blockchain.fromId(cryptoCurrency.network.id.value)) {
|
||||
Blockchain.TON, Blockchain.TONTestnet,
|
||||
Blockchain.Decimal, Blockchain.DecimalTestnet,
|
||||
-> return
|
||||
else -> {
|
||||
router.openUrl(
|
||||
url = getExplorerTransactionUrlUseCase(
|
||||
txHash = txHash,
|
||||
networkId = cryptoCurrency.network.id,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
getExplorerTransactionUrlUseCase(
|
||||
txHash = txHash,
|
||||
networkId = cryptoCurrency.network.id,
|
||||
).fold(
|
||||
ifLeft = { Timber.e(it.toString()) },
|
||||
ifRight = { router.openUrl(url = it) },
|
||||
)
|
||||
}
|
||||
|
||||
override fun onRefreshSwipe() {
|
||||
|
|
|
|||
|
|
@ -146,9 +146,11 @@ internal class WalletContentClickIntentsImplementor @Inject constructor(
|
|||
?.currency
|
||||
?: return@launch
|
||||
|
||||
router.openUrl(
|
||||
url = getExplorerTransactionUrlUseCase(txHash = txHash, networkId = currency.network.id),
|
||||
)
|
||||
getExplorerTransactionUrlUseCase(txHash = txHash, networkId = currency.network.id)
|
||||
.fold(
|
||||
ifLeft = { Timber.e(it.toString()) },
|
||||
ifRight = { router.openUrl(url = it) },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ web3j = "4.10.1"
|
|||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
tangemBlockchainSdk = "release-app_5.8-534"
|
||||
tangemBlockchainSdk = "release-app_5.8-536"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "release-app_5.8-336"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue