From b20cb42def4c2984deb9b513c9dcf40b2072c6bb Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Wed, 14 Aug 2024 14:49:17 +0200 Subject: [PATCH] \fix(@desktop/wallet): Fix register ENS flow which is currently broken --- ui/app/AppLayouts/Profile/views/EnsDetailsView.qml | 2 ++ ui/app/AppLayouts/Profile/views/EnsSearchView.qml | 2 ++ .../Profile/views/EnsTermsAndConditionsView.qml | 2 ++ ui/imports/shared/popups/send/SendModal.qml | 12 ++++++++++++ 4 files changed, 18 insertions(+) diff --git a/ui/app/AppLayouts/Profile/views/EnsDetailsView.qml b/ui/app/AppLayouts/Profile/views/EnsDetailsView.qml index a336197495..e72562e418 100644 --- a/ui/app/AppLayouts/Profile/views/EnsDetailsView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsDetailsView.qml @@ -126,6 +126,8 @@ Item { preDefinedAmountToSend: LocaleUtils.numberToLocaleString(0) preSelectedHoldingID: Constants.ethToken preSelectedHoldingType: Constants.TokenType.ERC20 + publicKey: root.contactsStore.myPublicKey + ensName: root.username sendTransaction: function() { if(bestRoutes.count === 1) { let path = bestRoutes.firstItem() diff --git a/ui/app/AppLayouts/Profile/views/EnsSearchView.qml b/ui/app/AppLayouts/Profile/views/EnsSearchView.qml index 85412790c3..116b817cf9 100644 --- a/ui/app/AppLayouts/Profile/views/EnsSearchView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsSearchView.qml @@ -72,6 +72,8 @@ Item { preDefinedAmountToSend: LocaleUtils.numberToLocaleString(0) preSelectedHoldingID: Constants.ethToken preSelectedHoldingType: Constants.TokenType.ERC20 + publicKey: root.contactsStore.myPublicKey + ensName: ensUsername.text sendTransaction: function() { if(bestRoutes.count === 1) { let path = bestRoutes.firstItem() diff --git a/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml b/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml index 50fea49f56..8c9ef13f7e 100644 --- a/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml +++ b/ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml @@ -76,6 +76,8 @@ Item { preDefinedAmountToSend: LocaleUtils.numberToLocaleString(10) preSelectedHoldingID: !!d.sntToken && !!d.sntToken.symbol ? d.sntToken.symbol: "" preSelectedHoldingType: Constants.TokenType.ERC20 + publicKey: root.contactsStore.myPublicKey + ensName: root.username sendTransaction: function() { if(bestRoutes.count === 1) { let path = bestRoutes.firstItem() diff --git a/ui/imports/shared/popups/send/SendModal.qml b/ui/imports/shared/popups/send/SendModal.qml index e983359d24..f169059e9c 100644 --- a/ui/imports/shared/popups/send/SendModal.qml +++ b/ui/imports/shared/popups/send/SendModal.qml @@ -43,6 +43,10 @@ StatusDialog { property int preSelectedChainId: 0 property string stickersPackId + // needed for registering ENS + property string publicKey + property string ensName + // token symbol property string preSelectedHoldingID property int preSelectedHoldingType: Constants.TokenType.Unknown @@ -266,6 +270,14 @@ StatusDialog { if (!!popup.stickersPackId) { d.extraParamsJson = "{\"%1\":\"%2\"}".arg(Constants.suggestedRoutesExtraParamsProperties.packId).arg(popup.stickersPackId) } + + if (!!popup.ensName && !!popup.publicKey) { + d.extraParamsJson = "{\"%1\":\"%2\",\"%3\":\"%4\"}" + .arg(Constants.suggestedRoutesExtraParamsProperties.username) + .arg(popup.ensName) + .arg(Constants.suggestedRoutesExtraParamsProperties.publicKey) + .arg(popup.publicKey) + } } onClosed: popup.store.resetStoredProperties()