Skip to content

Commit f7788a3

Browse files
committed
fix(Ens): Search for ENS names doesn't work correctly
- use the standard `textEdited()` and `editingFinished()` TextInput signals instead of catching the key press with `Keys.onRelease` which might be janky with virtual keyboards - remove some useless props and imports Fixes #19105
1 parent 7994a35 commit f7788a3

File tree

4 files changed

+10
-31
lines changed

4 files changed

+10
-31
lines changed

ui/app/AppLayouts/Profile/ProfileLayout.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ StatusSectionLayout {
323323
implicitHeight: parent.height
324324
ensUsernamesStore: root.ensUsernamesStore
325325
walletAssetsStore: root.walletAssetsStore
326-
contactsStore: root.contactsStore
327326
networkConnectionStore: root.networkConnectionStore
328327
profileContentWidth: d.contentWidth
329328
onConnectUsernameRequested: (ensName, ownerAddress) => root.connectUsernameRequested(ensName, ownerAddress)

ui/app/AppLayouts/Profile/views/EnsSearchView.qml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ import StatusQ.Core.Backpressure
99
import StatusQ.Core.Theme
1010

1111
import utils
12-
import shared
1312
import shared.panels
1413
import shared.status
1514
import shared.controls
16-
import shared.popups.send
17-
import shared.stores.send
1815

1916
import AppLayouts.Profile.stores
2017

@@ -53,7 +50,7 @@ Item {
5350
return validationMessage === "";
5451
}
5552

56-
function onKeyReleased(ensUsername){
53+
function onEnsUsernameChanged(ensUsername){
5754
if (!validate(ensUsername)) {
5855
return;
5956
}
@@ -83,8 +80,7 @@ Item {
8380
source: Theme.svg("block-icon-white")
8481
width: 20
8582
height: 20
86-
anchors.horizontalCenter: parent.horizontalCenter
87-
anchors.verticalCenter: parent.verticalCenter
83+
anchors.centerIn: parent
8884
}
8985

9086
StatusBaseText {
@@ -116,9 +112,9 @@ Item {
116112
anchors.topMargin: Theme.bigPadding
117113
anchors.right: btnContinue.left
118114
anchors.rightMargin: Theme.bigPadding
119-
Keys.onReleased: {
120-
onKeyReleased(ensUsername.text);
121-
}
115+
116+
onEditingFinished: inputValue => onEnsUsernameChanged(inputValue)
117+
onTextEdited: inputValue => onEnsUsernameChanged(inputValue)
122118

123119
Connections {
124120
target: root.ensUsernamesStore.ensUsernamesModule

ui/app/AppLayouts/Profile/views/EnsTermsAndConditionsView.qml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import QtQuick.Layouts
33
import QtQuick.Controls
44

55
import utils
6-
76
import shared.popups
8-
import shared.status
9-
import shared.popups.send
10-
import shared.stores.send
117

128
import StatusQ
139
import StatusQ.Core
@@ -39,7 +35,7 @@ Item {
3935
model: !!d.sntToken && !!d.sntToken.balances ? d.sntToken.balances: null
4036
roleName: "balance"
4137
}
42-
property real sntBalance: !!sntToken && !!sntToken.decimals ? aggregator.value/(10 ** sntToken.decimals): 0
38+
readonly property real sntBalance: !!sntToken && !!sntToken.decimals ? aggregator.value/(10 ** sntToken.decimals): 0
4339
}
4440

4541
StatusBaseText {

ui/app/AppLayouts/Profile/views/EnsView.qml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@ import StatusQ.Core.Theme
1212
import utils
1313
import shared
1414
import shared.stores as SharedStores
15-
import shared.popups.send
1615

1716
import AppLayouts.Wallet.stores
18-
import AppLayouts.stores as AppLayoutStores
19-
20-
import "../stores"
17+
import AppLayouts.Profile.stores
2118

2219
Item {
2320
id: ensView
2421

2522
property EnsUsernamesStore ensUsernamesStore
2623
property WalletAssetsStore walletAssetsStore
2724

28-
property AppLayoutStores.ContactsStore contactsStore
2925
property SharedStores.NetworkConnectionStore networkConnectionStore
3026

3127
property int profileContentWidth
@@ -46,10 +42,6 @@ Item {
4642
signal registerUsernameRequested(string ensName)
4743
signal releaseUsernameRequested(string ensName, string senderAddress, int chainId)
4844

49-
Layout.fillHeight: true
50-
Layout.fillWidth: true
51-
clip: true
52-
5345
QtObject {
5446
id: d
5547

@@ -252,7 +244,7 @@ Item {
252244

253245
onBackBtnClicked: back()
254246

255-
onContinueClicked: {
247+
onContinueClicked: (output, username) => {
256248
if(output === "connected"){
257249
connect(username)
258250
} else {
@@ -339,7 +331,7 @@ Item {
339331

340332
profileContentWidth: ensView.profileContentWidth
341333
onAddBtnClicked: next("search")
342-
onSelectEns: {
334+
onSelectEns: (username, chainId) => {
343335
ensView.ensUsernamesStore.ensDetails(chainId, username)
344336
selectedUsername = username
345337
selectedChainId = chainId
@@ -357,7 +349,7 @@ Item {
357349

358350
onBackBtnClicked: back()
359351

360-
onReleaseUsernameRequested: {
352+
onReleaseUsernameRequested: (senderAddress) => {
361353
const name = RootStore.getNameForWalletAddress(senderAddress)
362354
if (name === "") {
363355
Global.openPopup(noAccountPopupComponent)
@@ -385,8 +377,6 @@ Item {
385377

386378
StatusBaseText {
387379
anchors.fill: parent
388-
font.pixelSize: Constants.keycard.general.fontSize2
389-
color: Theme.palette.directColor1
390380
text: qsTr("The account this username was bought with is no longer among active accounts.\nPlease add it and try again.")
391381
}
392382

@@ -400,6 +390,4 @@ Item {
400390
addedUsername = ensUsername;
401391
}
402392
}
403-
404393
}
405-

0 commit comments

Comments
 (0)