fix: sort the contact list by the preferred display name

This commit is contained in:
Lukáš Tinkl 2023-08-01 14:29:36 +02:00 committed by Lukáš Tinkl
parent cdcfe811f5
commit 403e85ded7
1 changed files with 15 additions and 1 deletions

View File

@ -89,6 +89,20 @@ Item {
}
}
]
proxyRoles: ExpressionRole {
function displayNameProxy(nickname, ensName, displayName, aliasName) {
return ProfileUtils.displayName(nickname, ensName, displayName, aliasName)
}
name: "preferredDisplayName"
expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias)
}
sorters: [
StringSorter {
roleName: "preferredDisplayName"
caseSensitivity: Qt.CaseInsensitive
}
]
}
delegate: ContactPanel {
@ -96,7 +110,7 @@ Item {
width: ListView.view.width
contactsStore: root.contactsStore
name: ProfileUtils.displayName(model.localNickname, model.ensName, model.displayName, model.alias)
name: model.preferredDisplayName
ensVerified: model.isEnsVerified
publicKey: model.pubKey
compressedPk: Utils.getCompressedPk(model.pubKey)