From 8050d2b274f635d5bd1c7853e214d93da820512c 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 e28eb79751..53833773b4 100644 --- a/ui/imports/shared/popups/send/SendModal.qml +++ b/ui/imports/shared/popups/send/SendModal.qml @@ -42,6 +42,10 @@ StatusDialog { property string preDefinedAmountToSend property string stickersPackId + // needed for registering ENS + property string publicKey + property string ensName + // token symbol property string preSelectedHoldingID property int preSelectedHoldingType: Constants.TokenType.Unknown @@ -256,6 +260,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()