From 6e854a4df4e4933d478e5eb1d48ccb34db610194 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Mon, 19 May 2025 02:41:34 +0300 Subject: fix: disable history navigation when filepicker is open (#39) --- internal/app/app.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'internal/app') diff --git a/internal/app/app.go b/internal/app/app.go index e7bbfbfa1..943f1b24e 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -40,6 +40,9 @@ type App struct { watcherCancelFuncs []context.CancelFunc cancelFuncsMutex sync.Mutex watcherWG sync.WaitGroup + + // UI state + filepickerOpen bool } func New(ctx context.Context, conn *sql.DB) (*App, error) { @@ -128,6 +131,16 @@ func (app *App) initTheme() { } } +// IsFilepickerOpen returns whether the filepicker is currently open +func (app *App) IsFilepickerOpen() bool { + return app.filepickerOpen +} + +// SetFilepickerOpen sets the state of the filepicker +func (app *App) SetFilepickerOpen(open bool) { + app.filepickerOpen = open +} + // Shutdown performs a clean shutdown of the application func (app *App) Shutdown() { // Cancel all watcher goroutines -- cgit v1.2.3