From 5c2922ce45e653d85b56cffec7d19c90e314fa13 Mon Sep 17 00:00:00 2001 From: Andre Azzolini Date: Wed, 16 Aug 2023 10:32:54 -0600 Subject: [PATCH] chore: focus first visible SVM when secrets change Previously, if there was a filter applied that hid the first SVM, we would incorrectly focus that hidden secret, which would prevent the ability to select secrets. --- pkg/tui/gui/cmp_secrets.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/tui/gui/cmp_secrets.go b/pkg/tui/gui/cmp_secrets.go index 83c6c10d..fb05a08f 100644 --- a/pkg/tui/gui/cmp_secrets.go +++ b/pkg/tui/gui/cmp_secrets.go @@ -204,8 +204,9 @@ func (self *SecretsComponent) createSVMs() error { } } - if len(self.secretVMs) > 0 { - self.activeSVM = self.secretVMs[0] + visibleSVMs := self.visibleSVMs() + if len(visibleSVMs) > 0 { + self.activeSVM = visibleSVMs[0] } curViewName := self.gui.g.CurrentView().Name()