Skip to content

Commit

Permalink
Merge branch 'feature/1.11.2_fix' into feature/fix_transfer_status
Browse files Browse the repository at this point in the history
# Conflicts:
#	v4/app/build.gradle
  • Loading branch information
ruixhuang committed Oct 24, 2024
2 parents c25556b + 8c67c2e commit 4f1e0a6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion v4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ext {
compileSdkVersion = 34

// App dependencies
abacusVersion = '1.13.2'
abacusVersion = '1.13.12'
carteraVersion = '0.1.15'
kollectionsVersion = '2.0.16'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ object DydxAlertsView : DydxComponent {
.background(color = ThemeColor.SemanticColor.layer_3.color, shape = shape)
.border(2.dp, ThemeColor.SemanticColor.layer_6.color, shape = shape)
.clip(shape)
.padding(16.dp)
.clickable {
item.tapAction?.invoke()
},
}
.padding(16.dp),
horizontalArrangement = Arrangement.spacedBy(ThemeShapes.HorizontalPadding),
verticalAlignment = Alignment.CenterVertically,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,20 @@ class DydxTransferStatusViewModel @Inject constructor(
RouteStatus.InProgress, RouteStatus.Step1, RouteStatus.NoHash -> ProgressStepView.Status.Custom("3")
},
title = localizer.localize("APP.ONBOARDING.DEPOSIT_TO_DYDX"),
tapAction = if (routeStatus != RouteStatus.NoHash && !status?.toChainStatus?.transactionUrl.isNullOrEmpty()) {
{
router.navigateTo(
route = status?.toChainStatus?.transactionUrl!!,
)
}
} else {
null
},
trailingIcon = if (routeStatus != RouteStatus.NoHash && !status?.toChainStatus?.transactionUrl.isNullOrEmpty()) {
R.drawable.icon_external_link
} else {
null
},
),
),
deleteAction = createDeleteAction(transfer, routeStatus),
Expand Down Expand Up @@ -213,7 +227,7 @@ class DydxTransferStatusViewModel @Inject constructor(
localizer = localizer,
title = when (routeStatus) {
RouteStatus.Completed -> localizer.localize("APP.V4_WITHDRAWAL.COMPLETED_TITLE")
RouteStatus.InProgress, RouteStatus.Step1 -> localizer.localize("APP.V4_DEPOSIT.IN_PROGRESS_TITLE")
RouteStatus.InProgress, RouteStatus.Step1 -> localizer.localize("APP.V4_WITHDRAWAL.IN_PROGRESS_TITLE")
RouteStatus.NoHash -> localizer.localize("APP.V4_WITHDRAWAL.CHECK_STATUS_TITLE")
},
text = when (routeStatus) {
Expand All @@ -233,18 +247,16 @@ class DydxTransferStatusViewModel @Inject constructor(
RouteStatus.InProgress, RouteStatus.NoHash -> ProgressStepView.Status.InProgress
},
title = localizer.localize("APP.ONBOARDING.INITIATED_WITHDRAWAL"),
tapAction = if (routeStatus != RouteStatus.NoHash && transfer?.transactionHash != null && mintscanUrl != null) {
tapAction = if (routeStatus != RouteStatus.NoHash && !status?.fromChainStatus?.transactionUrl.isNullOrEmpty()) {
{
val hash = transfer.transactionHash.removeRange(0, 2) // remove "0x"
val url = mintscanUrl.replace("{tx_hash}", hash)
router.navigateTo(
route = url,
route = status?.fromChainStatus?.transactionUrl!!,
)
}
} else {
null
},
trailingIcon = if (routeStatus != RouteStatus.NoHash && transfer?.transactionHash != null && mintscanUrl != null) {
trailingIcon = if (routeStatus != RouteStatus.NoHash && !status?.fromChainStatus?.transactionUrl.isNullOrEmpty()) {
R.drawable.icon_external_link
} else {
null
Expand Down Expand Up @@ -283,6 +295,20 @@ class DydxTransferStatusViewModel @Inject constructor(
"DESTINATION_CHAIN" to (transfer?.toChainName ?: ""),
),
),
tapAction = if (routeStatus != RouteStatus.NoHash && !status?.toChainStatus?.transactionUrl.isNullOrEmpty()) {
{
router.navigateTo(
route = status?.toChainStatus?.transactionUrl!!,
)
}
} else {
null
},
trailingIcon = if (routeStatus != RouteStatus.NoHash && !status?.toChainStatus?.transactionUrl.isNullOrEmpty()) {
R.drawable.icon_external_link
} else {
null
},
),
),
deleteAction = createDeleteAction(transfer, routeStatus),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DydxTransferInstanceStore @Inject constructor(
TransferType.transferOut -> DydxTransferInstance.TransferType.TRANSFER_OUT
else -> DydxTransferInstance.TransferType.DEPOSIT
},
transactionHash = hash,
transactionHash = hash.lowercase(),
fromChainId = transferInput.requestPayload?.fromChainId,
fromChainName = fromChainName,
toChainId = transferInput.requestPayload?.toChainId,
Expand Down

0 comments on commit 4f1e0a6

Please sign in to comment.