From e50aff65c283abc6b9a283e91587ea3f988cdd51 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Tue, 2 Jun 2020 17:15:26 -0400 Subject: [PATCH] Fix bug where spinner would spin forever if the stash is empty --- ui/stash.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/stash.go b/ui/stash.go index 443879e..bf09ec3 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -189,15 +189,14 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) { case gotStashMsg: m.loading = false - // If the server comes back with nothing then we've got everything if len(msg) == 0 { + // If the server comes back with nothing then we've got everything m.fullyLoaded = true - break + } else { + docs := wrapMarkdowns(userMarkdown, msg) + m.addMarkdowns(docs...) } - docs := wrapMarkdowns(userMarkdown, msg) - m.addMarkdowns(docs...) - m.loaded |= loadedStash if m.loaded.done() { m.state = stashStateReady