From 88117de11a50b96271473132fd1f4e2d5e25145a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 24 Jun 2024 21:54:14 -0700 Subject: [PATCH] c/r keys only work in interactive mode --- internal/tables/tables.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/internal/tables/tables.go b/internal/tables/tables.go index b330f29..887b632 100644 --- a/internal/tables/tables.go +++ b/internal/tables/tables.go @@ -255,11 +255,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case key.Matches(msg, m.keys.invr): m.invert_selection() case key.Matches(msg, m.keys.clen): - m.mode = modes.Cleaning - return m.quit(false) + if m.mode == modes.Interactive { + m.mode = modes.Cleaning + return m.quit(false) + } case key.Matches(msg, m.keys.rstr): - m.mode = modes.Restoring - return m.quit(false) + if m.mode == modes.Interactive { + m.mode = modes.Restoring + return m.quit(false) + } case key.Matches(msg, m.keys.quit): return m.quit(true) }