diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-03 11:32:14 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-06 19:34:32 +1000 |
commit | bc9a99387f68afb24863d17ab4d29c1686843a76 (patch) | |
tree | aac694046f93d457177086d4c5afb5a0c12ea302 /pkg/gui/filtering_menu_panel.go | |
parent | 5289d49f75e9735f129e1f8e2a2f9dc74373515b (diff) |
refactor of contexts and filtering
Diffstat (limited to 'pkg/gui/filtering_menu_panel.go')
-rw-r--r-- | pkg/gui/filtering_menu_panel.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/pkg/gui/filtering_menu_panel.go b/pkg/gui/filtering_menu_panel.go index 75c1e1c86..935b58af1 100644 --- a/pkg/gui/filtering_menu_panel.go +++ b/pkg/gui/filtering_menu_panel.go @@ -30,8 +30,7 @@ func (gui *Gui) handleCreateFilteringMenuPanel() error { menuItems = append(menuItems, &menuItem{ displayString: fmt.Sprintf("%s '%s'", gui.Tr.LcFilterBy, fileName), onPress: func() error { - gui.State.Modes.Filtering.Path = fileName - return gui.Errors.ErrRestart + return gui.setFiltering(fileName) }, }) } @@ -42,8 +41,7 @@ func (gui *Gui) handleCreateFilteringMenuPanel() error { return gui.prompt(promptOpts{ title: gui.Tr.LcEnterFileName, handleConfirm: func(response string) error { - gui.State.Modes.Filtering.Path = strings.TrimSpace(response) - return gui.Errors.ErrRestart + return gui.setFiltering(strings.TrimSpace(response)) }, }) }, @@ -52,10 +50,7 @@ func (gui *Gui) handleCreateFilteringMenuPanel() error { if gui.State.Modes.Filtering.Active() { menuItems = append(menuItems, &menuItem{ displayString: gui.Tr.LcExitFilterMode, - onPress: func() error { - gui.State.Modes.Filtering.Path = "" - return gui.Errors.ErrRestart - }, + onPress: gui.clearFiltering, }) } |