chore(UserListPanel): speed up sorting by removing ExpressionRole

- for sorting purposes, we can achieve the same effect with a simple
`JoinRole` instead

Iterates: #11059
This commit is contained in:
Lukáš Tinkl 2024-09-05 15:24:55 +02:00
parent fdb72e6fde
commit 9730bfd6b6
No known key found for this signature in database
GPG Key ID: 4ABB993B9382F296
2 changed files with 5 additions and 8 deletions

View File

@ -45,7 +45,7 @@ SplitView {
// mainModuleInst mock
QtObject {
function getContactDetailsAsJson(publicKey, getVerificationRequest) {
return JSON.stringify({ ensVerified: false })
return JSON.stringify({ ensVerified: publicKey === "0x04d1bed192343f470f1255" }) // make Richard "ENS verified"
}
Component.onCompleted: {
Utils.mainModuleInst = this
@ -66,7 +66,7 @@ SplitView {
sourceComponent: UserListPanel {
usersModel: model
label: "Some label"
label: "Members"
}
}
}

View File

@ -90,13 +90,10 @@ Item {
model: SortFilterProxyModel {
sourceModel: root.usersModel
proxyRoles: FastExpressionRole {
function displayNameProxy(nickname, ensName, displayName, aliasName) {
return ProfileUtils.displayName(nickname, ensName, displayName, aliasName)
}
proxyRoles: JoinRole {
name: "preferredDisplayName"
expectedRoles: ["localNickname", "ensName", "displayName", "alias"]
expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias)
roleNames: ["localNickname", "ensName", "displayName", "alias"]
separator: ""
}
sorters: [