2020-03-29 01:31:34 +02:00
|
|
|
package gui
|
|
|
|
|
|
|
|
func (gui *Gui) validateNotInFilterMode() (bool, error) {
|
2020-08-22 03:44:03 +02:00
|
|
|
if gui.State.Modes.Filtering.Active() {
|
2020-08-15 08:38:16 +02:00
|
|
|
err := gui.ask(askOpts{
|
2020-11-16 11:38:26 +02:00
|
|
|
title: gui.Tr.MustExitFilterModeTitle,
|
|
|
|
prompt: gui.Tr.MustExitFilterModePrompt,
|
|
|
|
handleConfirm: gui.exitFilterMode,
|
2020-08-15 08:36:39 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
return false, err
|
2020-03-29 01:31:34 +02:00
|
|
|
}
|
|
|
|
return true, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (gui *Gui) exitFilterMode() error {
|
2020-08-22 03:05:37 +02:00
|
|
|
gui.State.Modes.Filtering.Path = ""
|
2020-03-29 01:31:34 +02:00
|
|
|
return gui.Errors.ErrRestart
|
|
|
|
}
|