diff --git a/v4/build.gradle b/v4/build.gradle index f9bce978..f79990c5 100644 --- a/v4/build.gradle +++ b/v4/build.gradle @@ -89,7 +89,7 @@ ext { compileSdkVersion = 34 // App dependencies - abacusVersion = '1.4.12' + abacusVersion = '1.4.13' carteraVersion = '0.1.12' kollectionsVersion = '2.0.16' diff --git a/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt b/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt index d12b6f14..72eba895 100644 --- a/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt +++ b/v4/feature/shared/src/main/java/exchange/dydx/trading/feature/shared/bottombar/DydxBottomBar.kt @@ -157,7 +157,11 @@ object DydxBottomBar : DydxComponent { overflow = TextOverflow.Ellipsis, ) }, - onClick = { barItem.onTapAction?.invoke() }, + onClick = { + if (!barItem.selected) { + barItem.onTapAction?.invoke() + } + }, ) } diff --git a/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt b/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt index ddad69e7..6a256b45 100644 --- a/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt +++ b/v4/feature/transfer/src/main/java/exchange/dydx/trading/feature/transfer/faucet/DydxTransferFaucetViewModel.kt @@ -23,12 +23,22 @@ class DydxTransferFaucetViewModel @Inject constructor( return DydxTransferFaucetView.ViewState( localizer = localizer, ctaButtonAction = { - abacusStateManager.faucet(100) - - platformInfo.show( - title = "Faucet Request Submitted", - message = "Your portofolio balance will be updated after a short while.", - ) + abacusStateManager.faucet(100) { + when (it) { + is AbacusStateManagerProtocol.SubmissionStatus.Success -> { + platformInfo.show( + title = "Faucet Request Submitted", + message = "Your portofolio balance will be updated after a short while.", + ) + } + is AbacusStateManagerProtocol.SubmissionStatus.Failed -> { + platformInfo.show( + title = "Faucet Request Failed", + message = it.error?.message ?: "Unknown error", + ) + } + } + } }, ) } diff --git a/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt b/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt index 11bbba2d..01e9f4eb 100644 --- a/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt +++ b/v4/integration/dydxStateManager/src/main/java/exchange/dydx/dydxstatemanager/AbacusStateManager.kt @@ -84,7 +84,7 @@ interface AbacusStateManagerProtocol { fun trade(input: String?, type: TradeInputField?) fun closePosition(input: String?, type: ClosePositionInputField) fun transfer(input: String?, type: TransferInputField?) - fun faucet(amount: Int) + fun faucet(amount: Int, statusCallback: (SubmissionStatus) -> Unit) fun setOrderbookMultiplier(multiplier: OrderbookGrouping) fun placeOrder(statusCallback: (SubmissionStatus) -> Unit) @@ -287,10 +287,12 @@ class AbacusStateManager @Inject constructor( asyncStateManager.transfer(input, type) } - override fun faucet(amount: Int) { - asyncStateManager.faucet(amount.toDouble()) { successful, _, _ -> - if (!successful) { - // Handle failure + override fun faucet(amount: Int, statusCallback: (AbacusStateManagerProtocol.SubmissionStatus) -> Unit) { + asyncStateManager.faucet(amount.toDouble()) { successful, error, _ -> + if (successful) { + statusCallback(AbacusStateManagerProtocol.SubmissionStatus.Success) + } else { + statusCallback(AbacusStateManagerProtocol.SubmissionStatus.Failed(error)) } } } diff --git a/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt b/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt index 8e2d9947..2808c94b 100644 --- a/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt +++ b/v4/platformUI/src/main/java/exchange/dydx/platformui/components/icons/PlatformIcons.kt @@ -75,7 +75,7 @@ private fun iconModel(icon: Any?): Any? { @Composable fun PlatformRoundIcon( icon: Any?, - backgroundColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.layer_4, + backgroundColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.layer_5, borderColor: ThemeColor.SemanticColor = ThemeColor.SemanticColor.transparent, iconTint: ThemeColor.SemanticColor? = ThemeColor.SemanticColor.text_primary, size: Dp = 60.dp,