Tidying up

This commit is contained in:
Christian Rocha 2020-11-11 16:14:38 -05:00 committed by Christian Rocha
parent 899c038402
commit 759b8707f8

View file

@ -215,8 +215,8 @@ func (m stashModel) countMarkdowns(t markdownType) (found int) {
} }
// Returns the stashed markdown notes. When the model state indicates that // Returns the stashed markdown notes. When the model state indicates that
// filtering is desired this also filters and ranks the notes by the search term // filtering is desired, this also filters and ranks the notes by the search
// in the searchinput field. // term in the searchInput field.
func (m *stashModel) getNotes() []*markdown { func (m *stashModel) getNotes() []*markdown {
if m.searchInput.Value() == "" { if m.searchInput.Value() == "" {
return m.markdowns return m.markdowns
@ -463,7 +463,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
// esc only passed trough in stashStateSearchNotes // esc only passed trough in stashStateSearchNotes
case "esc": case "esc":
m.state = stashStateReady m.state = stashStateReady
m.searchInput.SetValue("") // clear the searchinput m.searchInput.SetValue("") // clear the searchInput
m.setTotalPages() m.setTotalPages()
// Open document // Open document
@ -520,11 +520,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
// Stash // Stash
case "s": case "s":
if m.authStatus != authOK || m.selectedMarkdown() == nil { if pages == 0 || m.authStatus != authOK || m.selectedMarkdown() == nil {
break
}
if pages == 0 {
break break
} }