Take note internally when the local file search is finished

This commit is contained in:
Christian Rocha 2020-07-14 19:18:38 -04:00 committed by Christian Muehlhaeuser
commit cb8f7fcd19

View file

@ -103,6 +103,7 @@ func (s stashLoadedState) done() bool {
const (
loadedStash stashLoadedState = 1 << iota
loadedNews
loadedLocalFiles
)
type stashModel struct {
@ -232,6 +233,10 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
}
cmds = append(cmds, findNextLocalFile(m))
// We're finished searching for local files
case localFileSearchFinished:
m.loaded |= loadedLocalFiles
// Stash results have come in from the server
case gotStashMsg:
m.loading = false
@ -249,6 +254,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
m.state = stashStateReady
}
// News has come in from the server
case gotNewsMsg:
if len(msg) > 0 {
docs := wrapMarkdowns(newsMarkdown, msg)