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:
parent
fdb72e6fde
commit
9730bfd6b6
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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: [
|
||||
|
|
Loading…
Reference in New Issue