Skip to content

Commit

Permalink
Load the whole stash, page by page, automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Nov 20, 2020
1 parent 5023d4a commit c16a146
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion ui/stash.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,14 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
m.loadingFromNetwork = false
docs = wrapMarkdowns(stashedMarkdown, msg)

// 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.stashFullyLoaded = true
} else {
// Load the next page
m.page++
cmds = append(cmds, loadStash(m))
}

case gotNewsMsg:
Expand Down
3 changes: 0 additions & 3 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.stash.setSize(msg.Width, msg.Height)
m.pager.setSize(msg.Width, msg.Height)

// TODO: load more stash pages if we've resized, are on the last page,
// and haven't loaded more pages yet.

case initLocalFileSearchMsg:
m.localFileFinder = msg.ch
m.general.cwd = msg.cwd
Expand Down

0 comments on commit c16a146

Please sign in to comment.