From 054be73bc2378c65d38726399220ec5c53bd9150 Mon Sep 17 00:00:00 2001 From: Leo Robinovitch Date: Mon, 4 Jul 2022 12:49:24 -0700 Subject: [PATCH] Fix bug where updates reset viewport xoffset --- internal/tui/components/app/app.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/tui/components/app/app.go b/internal/tui/components/app/app.go index 7edecafc..f3f277d9 100644 --- a/internal/tui/components/app/app.go +++ b/internal/tui/components/app/app.go @@ -234,8 +234,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if msg.Page == m.currentPage { m.getCurrentPageModel().SetHeader(msg.TableHeader) m.getCurrentPageModel().SetAllPageData(msg.AllPageData) + if m.currentPageLoading() { + m.getCurrentPageModel().SetViewportXOffset(0) + } m.getCurrentPageModel().SetLoading(false) - m.getCurrentPageModel().SetViewportXOffset(0) switch m.currentPage { case nomad.LogsPage: