From 8cf618eef482cb28c121f4760927ca63083b084a Mon Sep 17 00:00:00 2001 From: lucor Date: Mon, 28 Feb 2022 19:01:15 +0100 Subject: [PATCH] gui: update filter to be case insensitive --- internal/paw/vault.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/paw/vault.go b/internal/paw/vault.go index b15c74d..ea2bf55 100644 --- a/internal/paw/vault.go +++ b/internal/paw/vault.go @@ -100,7 +100,7 @@ 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 { @@ -108,7 +108,7 @@ func (v *Vault) FilterItemMetadata(opts *VaultFilterOptions) []*Metadata { } 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)