From 2748e75165c04e3bbe15decc66a9216a24b9f2bf Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 25 Nov 2020 21:33:44 -0500 Subject: [PATCH] If we're offline disable the news section --- ui/stash.go | 4 ++++ ui/ui.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/stash.go b/ui/stash.go index 5aa0379..a58fbd6 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -613,6 +613,10 @@ func (m *stashModel) handleDocumentBrowsing(msg tea.Msg) tea.Cmd { // Show news case "n": + if m.general.authStatus == authFailed { + // If we're offline disable the news section + return nil + } if m.state == stashStateShowNews { // Exit news m.state = stashStateReady diff --git a/ui/ui.go b/ui/ui.go index 213812c..a4f2c6a 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -147,8 +147,8 @@ type general struct { type model struct { general *general - keygenState keygenState state state + keygenState keygenState fatalErr error // Sub-models