Fix bug where spinner would spin forever if the stash is empty

This commit is contained in:
Christian Rocha 2020-06-02 17:15:26 -04:00 committed by Christian Muehlhaeuser
parent 213df4ad7f
commit e50aff65c2

View file

@ -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