From 82102cdcddff05c751d0221267c7653e3639278e Mon Sep 17 00:00:00 2001 From: Koustav Date: Tue, 13 Aug 2024 14:04:07 +0530 Subject: [PATCH] update: On delete a saved filter user have to confirm their action --- pkg/model/savedFilters.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/model/savedFilters.go b/pkg/model/savedFilters.go index 928ac80..c5ac539 100644 --- a/pkg/model/savedFilters.go +++ b/pkg/model/savedFilters.go @@ -170,15 +170,20 @@ func (m modelFilter) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if msg.String() == "ctrl+c" { return m, tea.Quit } + if msg.String() == "q" { + return m, tea.Quit + } if msg.String() == "a" || msg.Type == tea.KeyEnter { selectedFilterApply = m.list.SelectedItem().(Item) return m, tea.Quit } if msg.String() == "d" { - // selectedFilterDelete = m.list.SelectedItem().(Item) deleteFilterState = true return m, nil - + } + if msg.String() != "d"{ + deleteFilterState = false + return m,nil } if msg.String() == "y" { selectedFilterDelete = m.list.SelectedItem().(Item)