chore(settings/messaging): improve contact filter expressions
This commit is contained in:
parent
beb4658633
commit
29add2fbc9
|
@ -68,10 +68,8 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchPredicate(name, pubkey) {
|
function searchPredicate(name, pubkey) {
|
||||||
if (root.searchString === "") return true
|
const lowerCaseSearchString = root.searchString.toLowerCase()
|
||||||
|
const compressedPubkey = Utils.getCompressedPk(pubkey)
|
||||||
let lowerCaseSearchString = root.searchString.toLowerCase()
|
|
||||||
let compressedPubkey = Utils.getCompressedPk(pubkey)
|
|
||||||
|
|
||||||
return name.toLowerCase().includes(lowerCaseSearchString) ||
|
return name.toLowerCase().includes(lowerCaseSearchString) ||
|
||||||
pubkey.toLowerCase().includes(lowerCaseSearchString) ||
|
pubkey.toLowerCase().includes(lowerCaseSearchString) ||
|
||||||
|
@ -81,9 +79,10 @@ Item {
|
||||||
filters: [
|
filters: [
|
||||||
ExpressionFilter { expression: filteredModel.panelUsagePredicate(model.isVerified) },
|
ExpressionFilter { expression: filteredModel.panelUsagePredicate(model.isVerified) },
|
||||||
ExpressionFilter {
|
ExpressionFilter {
|
||||||
|
enabled: root.searchString !== ""
|
||||||
expression: {
|
expression: {
|
||||||
root.searchString // ensure expression is reevaluated when searchString changes
|
root.searchString // ensure expression is reevaluated when searchString changes
|
||||||
filteredModel.searchPredicate(model.displayName, model.pubKey)
|
return filteredModel.searchPredicate(model.displayName, model.pubKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue