Skip to content

Commit

Permalink
Enhance search functionality with AND-based matching
Browse files Browse the repository at this point in the history
  • Loading branch information
nzin4x committed Nov 30, 2024
1 parent 6c30495 commit 6a6898e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/Popup/MainBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ export default Vue.extend({
if (this.searchText === "") {
return true;
}
if (
entry.issuer.toLowerCase().includes(this.searchText.toLowerCase()) ||
entry.account.toLowerCase().includes(this.searchText.toLowerCase())
) {
return true;
} else {
return false;
}
const keywords = this.searchText.toLowerCase().split(" ").filter(Boolean);
return keywords.every(
(keyword) =>
entry.issuer.toLowerCase().includes(keyword) ||
entry.account.toLowerCase().includes(keyword)
);
},
clearFilter() {
this.$store.dispatch("accounts/clearFilter");
Expand Down

0 comments on commit 6a6898e

Please sign in to comment.