Updated on 2026-08-14
This commit is contained in:
parent
70573a3e0e
commit
e012b2859b
3 changed files with 10 additions and 14 deletions
|
|
@ -2,7 +2,6 @@ package com.tangem.tap.features.send.redux
|
|||
|
||||
import com.tangem.Message
|
||||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.tangem_sdk_new.ui.animation.VoidCallback
|
||||
import com.tangem.tap.common.redux.ErrorAction
|
||||
import com.tangem.tap.common.redux.ToastNotificationAction
|
||||
import com.tangem.tap.domain.TapError
|
||||
|
|
@ -118,8 +117,8 @@ sealed class SendAction : SendScreenAction {
|
|||
|
||||
sealed class Dialog : SendAction() {
|
||||
data class ShowTezosWarningDialog(
|
||||
val reduceCallback: VoidCallback,
|
||||
val sendAllCallback: VoidCallback,
|
||||
val reduceCallback: () -> Unit,
|
||||
val sendAllCallback: () -> Unit,
|
||||
val reduceAmount: BigDecimal,
|
||||
) : Dialog()
|
||||
object Hide : Dialog()
|
||||
|
|
|
|||
|
|
@ -11,20 +11,20 @@ data class PendingTransaction(
|
|||
val type: PendingTransactionType
|
||||
)
|
||||
|
||||
enum class PendingTransactionType { Incoming, Outgoing, Unknown }
|
||||
enum class PendingTransactionType { Incoming, Outgoing }
|
||||
|
||||
fun TransactionData.toPendingTransaction(walletAddress: String): PendingTransaction? {
|
||||
if (this.status == TransactionStatus.Confirmed) return null
|
||||
|
||||
val type: PendingTransactionType = when {
|
||||
// this.sourceAddress == walletAddress -> {
|
||||
// PendingTransactionType.Outgoing
|
||||
// }
|
||||
// this.destinationAddress == walletAddress -> {
|
||||
// PendingTransactionType.Incoming
|
||||
// }
|
||||
this.sourceAddress == walletAddress -> {
|
||||
PendingTransactionType.Outgoing
|
||||
}
|
||||
this.destinationAddress == walletAddress -> {
|
||||
PendingTransactionType.Incoming
|
||||
}
|
||||
else -> {
|
||||
PendingTransactionType.Unknown
|
||||
return null
|
||||
}
|
||||
}
|
||||
val address = if (this.sourceAddress == walletAddress) {
|
||||
|
|
|
|||
|
|
@ -43,17 +43,14 @@ class PendingTransactionsAdapter
|
|||
val transactionDescriptionRes = when (transaction.type) {
|
||||
PendingTransactionType.Incoming -> R.string.wallet_pending_tx_receiving
|
||||
PendingTransactionType.Outgoing -> R.string.wallet_pending_tx_sending
|
||||
PendingTransactionType.Unknown -> return
|
||||
}
|
||||
val transactionAddressRes = when (transaction.type) {
|
||||
PendingTransactionType.Incoming -> R.string.wallet_pending_tx_receiving_address_format
|
||||
PendingTransactionType.Outgoing -> R.string.wallet_pending_tx_sending_address_format
|
||||
PendingTransactionType.Unknown -> return
|
||||
}
|
||||
val image = when (transaction.type) {
|
||||
PendingTransactionType.Incoming -> R.drawable.ic_arrow_left
|
||||
PendingTransactionType.Outgoing -> R.drawable.ic_arrow_right_20
|
||||
PendingTransactionType.Unknown -> return
|
||||
}
|
||||
view.tv_pending_transaction.text = view.context.getString(transactionDescriptionRes)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue