Skip to content

Commit

Permalink
MOB-283 Repeatedly tapping on currently selected tab icon cause s (#8)
Browse files Browse the repository at this point in the history
* MOB-283 Repeatedly tapping on currently selected tab icon cause screen to flash

* MOB-289 Background circle not showing on Light mode

* Show faucet error

* Bump Abacus
  • Loading branch information
ruixhuang authored Mar 5, 2024
1 parent 613eaaf commit d7ae329
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ object DydxBottomBar : DydxComponent {
overflow = TextOverflow.Ellipsis,
)
},
onClick = { barItem.onTapAction?.invoke() },
onClick = {
if (!barItem.selected) {
barItem.onTapAction?.invoke()
}
},
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}
}
}
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d7ae329

Please sign in to comment.