Skip to content

Commit

Permalink
gui: update filter to be case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
lucor committed Feb 28, 2022
1 parent 487c432 commit 8cf618e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/paw/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ func (v *Vault) Range(f func(id string, meta *Metadata) bool) {

func (v *Vault) FilterItemMetadata(opts *VaultFilterOptions) []*Metadata {
metadata := []*Metadata{}
nameFilter := opts.Name
nameFilter := strings.ToLower(opts.Name)

for t, itemMetadataByType := range v.ItemMetadata {
if opts.ItemType != 0 && (opts.ItemType&t) == 0 {
continue
}

for _, itemMetadata := range itemMetadataByType {
if nameFilter != "" && !strings.Contains(itemMetadata.Name, nameFilter) {
if nameFilter != "" && !strings.Contains(strings.ToLower(itemMetadata.Name), nameFilter) {
continue
}
metadata = append(metadata, itemMetadata)
Expand Down

0 comments on commit 8cf618e

Please sign in to comment.