Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(uphold): activate topper by reverting (#1186) #1203

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import org.dash.wallet.common.util.observe
import org.dash.wallet.common.util.openCustomTab
import org.dash.wallet.common.util.toFormattedString
import org.dash.wallet.integration.uphold.R
import org.dash.wallet.integration.uphold.api.UpholdClient
import org.dash.wallet.integration.uphold.data.RequirementsCheckResult
import org.dash.wallet.integration.uphold.data.UpholdConstants

Expand Down Expand Up @@ -85,7 +84,7 @@ class UpholdPortalFragment : Fragment(R.layout.fragment_integration_portal) {
binding.toolbarIcon.setImageResource(R.drawable.ic_uphold)
binding.disconnectedIndicator.isVisible = false
binding.balanceHeader.text = getString(R.string.uphold_account_dash_balance)
binding.additionalInfo.isVisible = false // true TODO: re-enable
binding.additionalInfo.isVisible = true
binding.additionalInfoIcon.setImageResource(R.drawable.logo_topper)
binding.additionalInfoTxt.text = getString(R.string.uphold_powered_by)
binding.convertBtn.isVisible = false
Expand All @@ -101,16 +100,10 @@ class UpholdPortalFragment : Fragment(R.layout.fragment_integration_portal) {
}

binding.buyBtn.setOnClickListener {
// val uri = viewModel.topperBuyUrl(getString(R.string.dash_wallet_name))
// viewModel.logEvent(AnalyticsConstants.Topper.ENTER_UPHOLD)
// requireActivity().openCustomTab(uri) TODO: re-enable Topper

val dashCard = UpholdClient.getInstance().currentDashCard
if (dashCard != null) {
val url = String.format(UpholdConstants.CARD_URL_BASE, dashCard.id)
requireActivity().openCustomTab(url)
} else {
showErrorAlert(-1)
lifecycleScope.launch {
val uri = viewModel.topperBuyUrl(getString(R.string.dash_wallet_name))
viewModel.logEvent(AnalyticsConstants.Topper.ENTER_UPHOLD)
requireActivity().openCustomTab(uri)
Comment on lines +103 to +106
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

topperBuyUrl was changed to suspend

}
}
binding.transferBtn.setOnClickListener {
Expand Down Expand Up @@ -239,7 +232,7 @@ class UpholdPortalFragment : Fragment(R.layout.fragment_integration_portal) {
private fun setConnectedState(isConnected: Boolean) {
binding.connectedGroup.isVisible = isConnected
binding.linkAccountBtn.isVisible = !isConnected
// binding.additionalInfo.isVisible = !isConnected // TODO: re-enable
binding.additionalInfo.isVisible = !isConnected
binding.transferBtn.isEnabled = isConnected
binding.transferIcon.setRoundedBackground(
if (isConnected) {
Expand All @@ -248,16 +241,6 @@ class UpholdPortalFragment : Fragment(R.layout.fragment_integration_portal) {
R.style.DisabledCircle
}
)

// TODO: remove when re-enabled
binding.buyBtn.isEnabled = isConnected
binding.buyIcon.setRoundedBackground(
if (isConnected) {
R.style.BuyDashCircle
} else {
R.style.DisabledCircle
}
)
}

override fun onDestroyView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data class BuyAndSellDashServicesModel(
): Parcelable {
companion object {
fun getBuyAndSellDashServicesList() = listOf(
// BuyAndSellDashServicesModel(ServiceType.TOPPER, ServiceStatus.IDLE), TODO: re-enable
BuyAndSellDashServicesModel(ServiceType.TOPPER, ServiceStatus.IDLE),
BuyAndSellDashServicesModel(ServiceType.UPHOLD, ServiceStatus.IDLE),
BuyAndSellDashServicesModel(ServiceType.COINBASE, ServiceStatus.IDLE)
)
Expand Down
Loading