fix(@desktop/settings) contacts search doesn't work by compressed pk

This commit is contained in:
Michał Cieślak 2022-07-22 16:25:58 +02:00 committed by Iuri Matias
parent 1dfd1539f2
commit 499b360112
1 changed files with 7 additions and 4 deletions

View File

@ -18,12 +18,12 @@ Item {
property var contactsModel
property int panelUsage: Constants.contactsPanelUsage.unknownPosition
property int contactsListHeight: ((contactsList.count * contactsList.itemAtIndex(0).implicitHeight)+title.height)
property bool scrollbarOn: false
readonly property int contactsListHeight: ((contactsList.count * contactsList.itemAtIndex(0).implicitHeight)+title.height)
property string title: ""
property string searchString: ""
property string lowerCaseSearchString: searchString.toLowerCase()
readonly property string lowerCaseSearchString: searchString.toLowerCase()
readonly property int count: contactsList.count
signal contactClicked(string publicKey)
@ -167,9 +167,12 @@ Item {
onTextClicked: contactListRoot.textClicked(publicKey)
onShowVerificationRequest: contactListRoot.showVerificationRequest(publicKey)
readonly property string compressedPkLowerCase: Utils.getCompressedPk(publicKey).toLowerCase()
visible: searchString === "" ||
panelDelegate.name.toLowerCase().includes(lowerCaseSearchString) ||
panelDelegate.publicKey.toLowerCase().includes(lowerCaseSearchString)
name.toLowerCase().includes(lowerCaseSearchString) ||
publicKey.toLowerCase().includes(lowerCaseSearchString) ||
compressedPkLowerCase.includes(lowerCaseSearchString)
}
}
}