From 7863c8b0219ded95e1c3b021723ae65b67f8fa7a Mon Sep 17 00:00:00 2001 From: HashEngineering Date: Thu, 24 Oct 2024 12:28:54 -0700 Subject: [PATCH] fix(dashpay): username request fixes (#1317) * fix: improve identity verification url check * fix: retry button after username request failure on More screen * chore: use dpp 1.3.1-SNAPSHOT --- build.gradle | 2 +- .../de/schildbach/wallet/ui/dashpay/CreateIdentityService.kt | 2 +- wallet/src/de/schildbach/wallet/ui/more/MoreFragment.kt | 3 ++- .../wallet/ui/username/voting/VerifyIdentityFragment.kt | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index e1f5061c7..a6664eb07 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { coroutinesVersion = '1.6.4' ok_http_version = '4.9.1' dashjVersion = '21.1.2' - dppVersion = "1.3-SNAPSHOT" + dppVersion = "1.3.1-SNAPSHOT" hiltVersion = '2.51' hiltCompilerVersion = '1.2.0' hiltWorkVersion = '1.0.0' diff --git a/wallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityService.kt b/wallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityService.kt index 760911e1b..06ba75a94 100644 --- a/wallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityService.kt +++ b/wallet/src/de/schildbach/wallet/ui/dashpay/CreateIdentityService.kt @@ -707,7 +707,7 @@ class CreateIdentityService : LifecycleService() { platformRepo.updateBlockchainIdentityData(blockchainIdentityData, blockchainIdentity) blockchainIdentityData.verificationLink?.let { verificationLink -> - if (verificationLink.startsWith("https://") || verificationLink.startsWith("http://")) { + if (verificationLink.matches(Regex("^https?:\\/\\/.+\$"))) { IdentityVerify(platformRepo.platform.platform).createForDashDomain( blockchainIdentityData.username!!, verificationLink, diff --git a/wallet/src/de/schildbach/wallet/ui/more/MoreFragment.kt b/wallet/src/de/schildbach/wallet/ui/more/MoreFragment.kt index e7194017c..2802b7d3c 100644 --- a/wallet/src/de/schildbach/wallet/ui/more/MoreFragment.kt +++ b/wallet/src/de/schildbach/wallet/ui/more/MoreFragment.kt @@ -283,7 +283,8 @@ class MoreFragment : Fragment(R.layout.fragment_more) { } binding.retryRequestButton.setOnClickListener { - // TODO: restart CreateIdentityService + mainActivityViewModel.logEvent(AnalyticsConstants.UsersContacts.CREATE_USERNAME_TRYAGAIN) + createIdentityViewModel.retryCreateIdentity() } initViewModel() diff --git a/wallet/src/de/schildbach/wallet/ui/username/voting/VerifyIdentityFragment.kt b/wallet/src/de/schildbach/wallet/ui/username/voting/VerifyIdentityFragment.kt index 949053c6f..0d4f9814c 100644 --- a/wallet/src/de/schildbach/wallet/ui/username/voting/VerifyIdentityFragment.kt +++ b/wallet/src/de/schildbach/wallet/ui/username/voting/VerifyIdentityFragment.kt @@ -45,7 +45,7 @@ class VerifyIdentityFragment : Fragment(R.layout.fragment_verfiy_identity) { binding.linkInput.doOnTextChanged { text, _, _, _ -> val link = text.toString() - val isValidLink = link.startsWith("https://") || link.startsWith("http://") + val isValidLink = link.matches(Regex("^https?:\\/\\/.+\$")) binding.verifyBtn.isEnabled = isValidLink if (!text.isNullOrEmpty()) { binding.linkInputLayout.hint = getString(R.string.link)